Deductions & credits

You need to look at the "special rules for children of divorced or separated parents" in publication 501.

 

Briefly, only the parent where the child lives more than half the nights of the year (or half the time since birth for a newborn) has the automatic right to claim a child as a dependent.  Your daughter does not need a form 8332 from the father to claim her child as a dependent, because you say the child lives with your daughter for most of the time.  The father would need a form 8332 from your daughter if the father wanted to claim the child.  Your daughter is not obligated to give up her claim unless a court orders her to do so.  

https://www.irs.gov/pub/irs-pdf/p501.pdf