Exception where custodial parent releases claim to exemption for the year
For purposes of paragraph (1), the requirements described in this paragraph are met with respect to any calendar year if—
(A) the custodial parent signs a written declaration (in such manner and form as the Secretary may by regulations prescribe) that such custodial parent will not claim such child as a dependent for any taxable year beginning in such calendar year, and
(B) the noncustodial parent attaches such written declaration to the noncustodial parent’s return for the taxable year beginning during such calendar year.