A child cannot qualify as a dependent on more than one tax return, so the code has a set of rules to prevent this from happening. § 152(c)(4). The code first attempts to break the tie by limiting eligible taxpayers to the child's parents, followed by the contending non-parental taxpayer with the highest adjusted gross income. "Id." If more than one parent attempts to claim the child and they do not file a joint return, the code first attempts to break the tie in favor of the parent with whom the child resided longest during the taxable year. "Id." If that does not break the tie, the parent with the highest adjusted gross income wins the right to claim the child as a dependent. "Id."