IF the noncustodial parent qualifies they can claim:
ONLY the custodial parent can claim:
Per IRS Publication 17 Your Federal Income Tax, page 29:
Sometimes, a child meets the relationship, age, residency, support, and joint return tests to be a qualifying child of more than one person. Although the child is a qualifying child of each of these persons, only one person can actually treat the child as a qualifying child to take all of the following tax benefits (provided the person is eligible for each benefit).
The other person can’t take any of these benefits based on this qualifying child. In other words, you and the other person can’t agree to divide these benefits between you.
Tiebreaker rules. To determine which person can treat the child as a qualifying child to claim these five tax benefits, the following tiebreaker rules apply.
Subject to these tiebreaker rules, you and the other person may be able to choose which of you claims the child as a qualifying child.
Applying the tiebreaker rules to divorced or separated parents (or parents who live apart). If a child is treated as the qualifying child of the noncustodial parent under the rules described earlier for children of divorced or separated parents (or parents who live apart), only the noncustodial parent can claim the child as a dependent and the child tax credit or credit for other dependents for the child. However, only the custodial parent can claim the credit for child and dependent care expenses or the exclusion for dependent care benefits for the child, and only the custodial parent can treat the child as a dependent for the health coverage tax credit. Also, the noncustodial parent can't claim the child as a qualifying child for head of household filing status or the earned income credit. Instead, the custodial parent, if eligible, or other eligible person can claim the child as a qualifying child for those two benefits. If the child is the qualifying child of more than one person for these benefits, then the tiebreaker rules just explained determine whether the custodial parent or another eligible person can treat the child as a qualifying child.
See pages 27-32 of IRS Publication 17 for examples. Additionally, you can refer to IRS Publication 504 Divorced or Separated Individuals for more information about children of divorced or separated parents (or parents who live apart).