Publication 501 (
Publication 501 (2006), Exemptions, Standard Deduction, and Filing Information) says:
Children of divorced or separated parents.
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.
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, see Divorce decree or separation agreement made after 1984, later.)
b. A pre-1985 decree of divorce or separate maintenance or written separation agreement that applies to 2006 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.