If the child lived with both the parent and the grandparent for more than half the year, it makes no difference who pays for the child's support as long as the child did not pay for his/her own support.
The child can be the qualifying child dependent of either the parent or grandparent - you can decide which claims the child. In the case that you cannot decide then the parent prevails.
The absent father that did not live with the child cannot claim anything unless the mother releases the exemption (and child tax credit) to him with a signed 8332 form. If she does so then she (the mother) or grand parent can still claim the child for EIC and the child care credit.
If there is a decree or court order that the father can claim the child's exemption then the mother can be compelled to issue a 8332 form to the father. That would have to be enforced by the local court, the IRS only goes by physical custody unless there is a 8332 form with the absent parents tax return.