Carl
Level 15

After you file

The IRS does not care about your court order and are not bound by it. They have their own rules for who gets to claim what, and those rules can only be over-ridden by a federal judge. Since federal judges don't handle custody cases, that won't happen. The rules are in IRS Publication 504 at <a rel="nofollow" target="_blank" href="https://www.irs.gov/pub/irs-pdf/p504.pdf">https://www.irs.gov/pub/irs-pdf/p504.pdf</a>. For you, things start on page 7 of that document.
Now while the IRS may have their own rules at the federal level which can not be over ridden by a lower court, if there is a case of where a spouse needs to sign a form 8332 releasing a right of the custodial parent to claim something, to the non-custodial parent, the lower court can require the custodial parent to sign the form or face the legal wrath of that lower court. But without that signed 8332, the IRS will NOT honor the rulings of the lower court if said ruling goes against IRS rules.  (Just be aware of this stuff is all)