Get your taxes done using TurboTax

The IRS follows Federal tax law that only looks at the actual physical custody which must be *more* than half the tax year to determine custodial/noncustodial parent.   Local court orders cannot override Federal tax law, but they can compel that the parent where the child actually lived more than half the year, release the exemption to the other parent to comply with the divorce decree.   NOTE: that the EIC and child care credit can NEVER be claimed by the parent that the child did not live with more than half the year - those credits always stay with the parent where the child lived more than half the year.   

The other parent can only claim the child's exemption (dependent) and the child tax credit.

As stated above, if the child lived with both parents *exactly* the same number of nights, but not more than half the year, then the child cannot be claimed by anyone as a Qualifying Child under the special rules for divorced or separated parents that live apart.

For the full IRS rules see IRS Pub 17:
<a rel="nofollow" target="_blank" href="https://www.irs.gov/publications/p17/ch03.html#en_US_2016_publink1000170891">https://www.irs.gov/pub...>

Look under Qualifying Child -> Residency Test -> Children of divorced or separated parents (or parents who live apart).   For all of the rules.
**Disclaimer: This post is for discussion purposes only and is NOT tax advice. The author takes no responsibility for the accuracy of any information in this post.**