Thank you for your question.
You can only claim your grandchild if the following is true:
1. Lived with you more than half the year. In your case between January 1 and July is more than 183 days. You meet this test. AND
2. She is your biological grandchild
3. She can not be claimed on another person return (true)
4. grand child is a resident or citizen of the U.S. Mexico or Canada
5. The grand child did not provide for more than half of his own support.
The issue here is that if you were not awarded custody by the court, then the child could have still been considered resident with the parent. For determining qualifying child, even if you can claim the deduction, temporary time away from the home is not counted against the "living with the parents" rule.
If the parents claim this is a temporary time away from home, then the child is the qualifying child of both of you, the parents and the grandparents.
In this case, the tie breaker goes to the biological parent.
There is no time limit for what is considered temporary in this case.
It has to do with intention. How is it you came to have the child custody.
If you both end up claiming this child, then the IRS may have to settle the issue. AND they would use the tie breaker. You should each come to an agreement on this matter.
PROOF of living with you: to prove they lived with you, you can use school registration information, medical clinic registration information, mail they might have recieved, letters or notes or email written to you from the parents.