IF the noncustodial parent qualifies they can claim:
ONLY the custodial parent can claim:
Per IRS Publication 17 Your Federal Income Tax, page 28:
Special Rule for Qualifying Child of More Than One Person
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 meets the conditions to be a qualifying child of each of these persons, only one person can actually treat the child as a qualifying child. To meet this special test, you must be the person who can treat the child as a qualifying child. Only that person can 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 cannot take any of these benefits based on this qualifying child. In other words, you and the other person cannot agree to divide these tax benefits between you. The other person cannot take any of these tax benefits unless he or she has a different qualifying child.
To determine which person can treat the child as a qualifying child to claim these six tax benefits, the following tie-breaker rules apply.
Applying this special test to divorced or separated parents or parents who live apart.
If 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 an exemption and the child tax credit for the child. However, the custodial parent, if eligible, or other eligible person can claim the child as a qualifying child for head household filing status, the credit for child and dependent care expenses, the exclusion for dependent care benefits, and the earned income credit. If the child is the qualifying child of more than one person for these benefits, then the tiebreaker rules will determine which person can treat the child as a qualifying child.
Within this section of IRS Publication 17 there are multiple examples provided. 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).