Generally, whoever provides the bulk of the financial support can claim the children on the tax return. It doesn't matter how many months or days you provided the support, simply that your share of the support is more than 50%
There's a special test for divorced or legally separated parents, though. In this case, the "custodial parent" (simply, the one who had custody of the child for more than half the year) is treated as meeting the support test, even if the noncustodial parent actually paid most of the child's support.
If the split is amicable and both partners are interested in maximizing the tax benefit, the custodial parent is able to sign a waiver on Form 8332, allowing the noncustodial parent to claim the exemption for the child. The waiver can apply to the current year only, or all future years.
Furthermore, IRC section 151(c)(1) allows taxpayers an exemption for dependent children. In the case of divorced parents, the custodial parent gets the exemption. That parent, however, may release his or her claim to the exemption, allowing the noncustodial parent to claim the deduction. The custodial parent does this by signing Form 8332, Release of Claim to Exemption for Child of Divorced or Separated Parents, which the noncustodial parent attaches to his or her tax return.
In lieu of form 8332, the noncustodial parent may attach a written declaration conforming to the substance of form 8332. To meet the requirements of IRC section 152(e)(2), this statement must include the
1. Name of the dependent child.
2. Year(s) for which the claim to the exemption has been released.
3. Signature of the custodial parent confirming consent to release the tax exemption.
4. Social Security number of the custodial parent.
5. Date of the custodial parent’s signature.
6. Name and Social Security number of the parent claiming the exemption.
Special rules apply in the case of joint or “split” custody. In this situation, the parent who has custody for the greater part of the year is considered the custodial parent. An executed shared custody agreement incorporated as part of a divorce decree may stipulate the noncustodial parent is “entitled to claim” the children as dependents. However, such a stipulation may not effectively grant the dependency exemption to the noncustodial parent for federal tax purposes. A release of claim of exemption in a divorce decree must meet the written declaration requirements of section 152(e)(2).