The IRS will not look into your divorce decree and will not verify if the child support is paid or not. The IRS will also not ask about the immigration status.
If there is a court order and it is violated - ex-spouse may take you back to the court.
Under the IRS rules the custodial parent is the parent with whom the child lived for the greater part of the year. The other parent is the noncustodial parent.
The IRS will award dependency exemption to the custodial parent.
The custodial parent may release the claim to the noncustodial parent by signing the form 8332 - http://www.irs.gov/pub/irs-pdf/f8332.pdf - should be filed with the noncustodial parent's tax return. The non-custodial parent - you should obtain that form signed by the custodian parent for specified years.
Please refer to the IRS publication 504 - http://www.irs.gov/pub/irs-pdf/p504.pdf
If a child is treated as the qualifying child of the noncustodial parent under the special rule for divorced or separated parents, only the noncustodial parent can claim an exemption and the child tax credit for the child.
However, the noncustodial parent cannot claim the child for head of household filing status, the credit for child and dependent care expenses, the exclusion for dependent care benefits, and the earned income credit. Only the custodial parent (or other eligible taxpayer) can claim the child as a qualifying child for these four tax benefits.
Let me know if you need any help.