
Quoting
Bubba Jimmy
If your husband has a divorce decree granting him the dependent exemption for the child unconditionally then there is nothing you can do to prevent him from claiming the child, and if you also claim the child you will be required to pay back the excess refund or tax benefit you received for claiming a child you were not legally entitled to claim. Length of time won't matter, but the child will cease to qualify due to other rules at some point.
If the divorce decree grants him the exemption conditionally - for example, so long as he is current on his child support payments - then he would need to obtain from you a signed form 8332 in order to claim the exemption. If you refused, he could get a judge to order you to sign off on the exemption if he has complied with the child support requirement.