The three gateway rules come first and are the ones that catch people. Section 152(b) applies to both limbs. A person who is themselves someone's dependent is treated as having no dependents of their own, which stops a chain of claims running through a household. A person who has filed a joint return with a spouse generally cannot be claimed by anyone else, though the qualifying-child test at section 152(c)(1)(E) carves out a return filed only to claim a refund. And the person must be a U.S. citizen, national or resident, or a resident of a country contiguous to the United States, with a narrow exception for a child lawfully placed for adoption who lives with a U.S. citizen or national taxpayer as a member of the household.
The qualifying child test has five parts. The relationship must be a child of the taxpayer or a descendant of one, or a sibling or step-sibling or a descendant of one, where "child" is defined at section 152(f)(1) to include a stepchild and an eligible foster child, and an adopted child is treated as a child by blood. The child must have the same principal place of abode as the taxpayer for more than half the year. The age test requires the child to be younger than the taxpayer and either under 19 at the end of the calendar year or a student under 24, where "student" means full time for each of five calendar months. A child who is permanently and totally disabled meets the age test at any age. The child must not have provided over half of their own support. And the child must not have filed a joint return other than to claim a refund.
The qualifying relative test has four parts and one of them has no counterpart under the other limb. The relationship list is much longer and reaches parents and their ancestors, stepparents, nieces and nephews, aunts and uncles, and in-laws. It also has a catch-all: an unrelated individual who lived in the taxpayer's home as a member of the household for the whole year qualifies, which is the route a live-in partner or an elderly friend takes. Section 152(f)(3) shuts that route where the relationship violates local law. The person's gross income for the year must be under $5,300, a limit tied to the inflation-adjusted exemption amount and published by the IRS each year. The taxpayer must provide over half of the person's support. And the person must not be a qualifying child of the taxpayer or of anyone else.
The support test reverses between the two limbs, and reading it the wrong way round produces the wrong answer. Under the qualifying-child test the question is whether the child provided over half of their own support, so a student living on savings can fail even though nobody else supported them, while a child supported entirely by a grandparent can still be the parent's qualifying child. Under the qualifying-relative test the question is whether the taxpayer provided over half. Where several people together support one person and nobody clears half, section 152(d)(3) allows a multiple support agreement: anyone who contributed over 10 percent may claim, provided the other 10-percent contributors file written declarations that they will not. Two support rules are easy to miss. Alimony paid to a spouse is not treated as support of a dependent, and after a parent remarries, support received from the new spouse counts as coming from the parent.
When one child qualifies for two taxpayers, section 152(c)(4) ranks them. A parent outranks a non-parent. Between parents who do not file jointly, the child goes to the parent the child lived with longer, and then to the higher adjusted gross income. A non-parent can claim only where no parent does and the non-parent's adjusted gross income exceeds every parent's.
Being a dependent and being a qualifying person for head of household are different sets, in both directions. The head of household test reaches a qualifying child without requiring that the child be the taxpayer's dependent, and a qualifying relative who is not a qualifying child has to clear the gross income limit that no qualifying child ever faces. The two also part company on age. A dependent qualifying child is under 19, or under 24 as a student. The child tax credit uses under 17. The child and dependent care credit uses under 13. Three provisions, three ages, and each one is stated in its own section.