Get your taxes done using TurboTax

A person who does not live with the child in their home can rarely legally claim them as a dependent, regardless of custody or divorce agreements.

A rare exception would be a divorce or custody order filed in 2008 or earlier, that says that the non-custodial parent can claim the child as a dependent in certain years.  The custody order must have specific language and the taxpayer must attach a copy of the order to their tax return and mail it in.  (Even then, it is not an unrestricted claim.  The parent can claim the child as a dependent for the dependent exemption and the child tax credit, but never the child and dependent care credit, head of household, EIC or college tuition benefits.  Those benefits always stay with the relative who has custody.)

Assuming this person is not entitled to claim the child as a dependent, the IRS really has no way of knowing that unless a duplicate claim is filed by someone else.  In that case the IRS will send a letter saying "are you sure you didn't make a mistake" and if both taxpayers still insist that they are entitled to claim the same child, the IRS will ask for further proof of where the child actually lived for the year.  Proof from outside authorities is best, like letters to you from doctors, the public schools, etc. about the child.

If someone improperly claims your child as a dependent it may prevent you from e-filing, but you can print your return and mail it in.  The IRS will eventually start the investigation as mentioned above.