Deductions & credits

Probably the foster family.

 

Biological parents, adoptive parents, grand and great-grandparents, and foster parents, are all treated equally for claiming dependents. 

 

The child can be claimed as a dependent by a parent, grandparent, or foster parent where the child lived more than half the nights of the year (184 or more nights).  Based on your question, that sounds like the foster parents.

 

If the child did not live with any of the "parents" for 184 or more nights, then no one can claim him as a "qualifying child" dependent.  Someone might be able to claim him as a "qualifying relative" dependent, although this is only a $500 tax credit and not $2000, and does not allow the parent to claim EIC.  To claim the child as a qualifying relative dependent, the family would have to pay more than half the child's support for the year.  If no one paid more than half the child's support, then the only way for anyone to claim him is for everyone who provided more than 10% of his support to sign a "multiple support agreement" in which they all agree as to which person will claim the child.