Al-Hasan narrates from Sayyiduna Umar (may Allah be pleased with him) that the child will be with whichever of the parents is a Muslim.