The custodial parent gives the other a signed form 8332.
https://www.irs.gov/pub/irs-pdf/f8332.pdf
View solution in original post