Deductions & credits

All of this is covered in IRS publication 501 under the section “special rules for children of divorced or separated parents.”   https://www.irs.gov/forms-pubs/about-publication-501

If you and your ex agree to each claim one dependent, then your ex must give you a signed form 8332 releasing the dependent claim for one of the children. You will file an amended tax return that indicates that the children do not live with you and that you have a signed form 8332 for one of the children, which must be included with your return when you mail it. You will need to re-pay part of your excess refund. Your ex will file a tax return listing both children in which she indicates that they both live with her but that she gave you a signed form 8332 for one of them. She will be allowed to claim EIC and dependent care for both children if she qualifies, and will get the child tax credit for one of the children.