Qualifying child vs dependent 2022

What is best for tax purposes, to have a child as qualifying or as dependent?

 

What are the rules for a qualifying child in 2022?

Is a child who was 18 by the end of the year and lived with parent (head of household) most of the year and is not claimed by anyone as a dependent considered a qualifying child?

I read https://www.irs.gov/credits-deductions/individuals/child-tax-credit but the "generally" makes things not clear. So generally the child could not be 18, but not always?

Thanks!