Special rule relating to 2 or more who can claim the same qualifying child
(A) In general Except as provided in subparagraphs (B) and (C), if (but for this paragraph) an individual may be claimed as a qualifying child by 2 or more taxpayers for a taxable year beginning in the same calendar year, such individual shall be treated as the qualifying child of the taxpayer who is— (i) a parent of the individual, or (ii) if clause (i) does not apply, the taxpayer with the highest adjusted gross income for such taxable year.
(B) More than 1 parent claiming qualifying child If the parents claiming any qualifying child do not file a joint return together, such child shall be treated as the qualifying child of— (i) the parent with whom the child resided for the longest period of time during the taxable year, or (ii) if the child resides with both parents for the same amount of time during such taxable year, the parent with the highest adjusted gross income.
(C) No parent claiming qualifying child If the parents of an individual may claim such individual as a qualifying child but no parent so claims the individual, such individual may be claimed as the qualifying child of another taxpayer but only if the adjusted gross income of such taxpayer is higher than the highest adjusted gross income of any parent of the individual.