IRS Publication 501 spells this one out.
Children of divorced or separated parents (or parents who live apart). In most cases, because of the residency test, a child of divorced or separated parents is the qualifying child of the custodial parent. However, the child will be treated as the qualifying child of the noncustodial parent if all four of the following statements are true.
1.The parents:
a.Are divorced or legally separated under a decree of divorce or separate maintenance,
b.Are separated under a written separation agreement, or
c.Lived apart at all times during the last 6 months of the year, whether or not they are or were married.
2.The child received over half of his or her support for the year from the parents.
3.The child is in the custody of one or both parents for more than half of the year.
4.Either of the following statements is true.
a.The custodial parent signs a written declaration, discussed later, that he or she will not claim the child as a dependent for the year, and the noncustodial parent attaches this written declaration to his or her return. (If the decree or agreement went into effect after 1984 and before 2009, see Post-1984 and pre-2009 divorce decree or separation agreement , later. If the decree or agreement went into effect after 2008, see Post-2008 divorce decree or separation agreement , later.)
b.A pre-1985 decree of divorce or separate maintenance or written separation agreement that applies to 2012 states that the noncustodial parent can claim the child as a dependent, the decree or agreement was not changed after 1984 to say the noncustodial parent cannot claim the child as a dependent, and the noncustodial parent provides at least $600 for the child's support during the year.
Custodial parent and noncustodial parent. The custodial parent is the parent with whom the child lived for the greater number of nights during the year. The other parent is the noncustodial parent.
If the parents divorced or separated during the year and the child lived with both parents before the separation, the custodial parent is the one with whom the child lived for the greater number of nights during the rest of the year.
A child is treated as living with a parent for a night if the child sleeps:
•At that parent's home, whether or not the parent is present, or
•In the company of the parent, when the child does not sleep at a parent's home (for example, the parent and child are on vacation together).
Equal number of nights. If the child lived with each parent for an equal number of nights during the year, the custodial parent is the parent with the higher adjusted gross income (AGI).
December 31. The night of December 31 is treated as part of the year in which it begins. For example, December 31, 2012, is treated as part of 2012.
Emancipated child. If a child is emancipated under state law, the child is treated as not living with either parent. See Examples 5 and 6.
Absences. If a child was not with either parent on a particular night (because, for example, the child was staying at a friend's house), the child is treated as living with the parent with whom the child normally would have lived for that night, except for the absence. But if it cannot be determined with which parent the child normally would have lived or if the child would not have lived with either parent that night, the child is treated as not living with either parent that night.
Parent works at night. If, due to a parent's nighttime work schedule, a child lives for a greater number of days, but not nights, with the parent who works at night, that parent is treated as the custodial parent. On a school day, the child is treated as living at the primary residence registered with the school.
If the kids lived with you for the majority of the nights for the year, you get to claim them. Kinda plain spoken. If its an equal number of nights then it is the person with the highest income.
When you find out what the answer is, choose your battles wisely. If you legally have the upper hand it may be more favorable to demand a quick cash settlement with him (like that day quick, or you file your documentation with the IRS) I'd recommend doing your math ahead of time. Bringing the IRS into a divorce or separation battle raises the stakes. Be mentally ready for that.