The IRS will determine who should have the personal exemption for the dependent once they receive two or more tax returns claiming the same dependent's exemption.
The party that loses the investigation is required to pay back any tax refund plus penalties and interest.
To be a Qualifying Child -
1. The child must be your son, daughter, stepchild, foster child, brother, sister, half brother, half sister, stepbrother, stepsister, or a descendant of any of them.
2. The child must be (a) under age 19 at the end of the year, (b) under age 24 at the end of the year and a full-time student or (c) any age and permanently and totally disabled.
3. The child must have lived with you for more than half of the year. Temporary absences while away at college are considered living with you.
4. The child must not have provided more than half of his or her own support for the year.
5. If the child meets the rules to be a qualifying child of more than one person, you must be the person entitled to claim the child as a qualifying child.
6. The child must be a U.S. citizen or U.S., Canada or Mexico resident for some portion of the year.
7. The child must be younger than you unless disabled.
Anybody can "get away" with claiming a child dependent, they are not entitled to. It is impossible to prevent them from doing it. The way to "undo" it is very simple: the person who is entitled to claim the child (whether you or your daughter) files a return claiming the child. The IRS will sort it out. If you (or she) filed a return without the child on it; you can now file an amended return and claim the child
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.
If you are not related and this is not a legal foster placement but you have been caring for the child while the parent is away, you can claim them if the child was a member of your household for the entire year and you provided more than half their support, but some other dependent benefits are not allowed.
For very complicated situations there are tiebreaker rules, we can help you understand your situation if you provide more details.