Do you have a court order that awards the exemption claim to someone? If yes, then you follow the court order until there is another court order.
Because the federal income tax is governed by federal laws, the IRS is not bound by an order of a state judge. The IRS's basic rule is the parent with whom the child stays most of the time gets to claim the child as a dependent (as other factors are met).
However, because the parents are subject to the jurisdiction of the state court, failure to follow the court's order may result in penalty to the parent not following the court's order.
If both parents claim the same dependents, the IRS will ask both parents to provide proofs of being able to claim the dependents. The parent claiming dependents without a legal basis to do so may be penalized.
For more information on who is a dependent and who can claim a dependent, you can read the first few chapters of Publication 17 provided by the IRS. P17 is available for free at www.irs.gov .
Without knowing more about your situation, no one can comment specifically about your situation. For help that is specific to your situation, you may want to review your facts and options with an attorney.