All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
This question can be dealt with under the heading of nursing and guardianship, which mean taking care of those who are quite young and who do not distinguish between what is good for them and what is bad. This also includes protecting them from all what could harm them. So if the person has not yet reached the age of distinction (7 years old) it is more appropriate and righteous to let his mother do this job as she spends more time with him; she is more softhearted and forbearing when it comes to educating the child in this very period. The evidence for this is the following Hadeeth. A woman came to the Prophet and said that her husband who divorced her wanted to take their son with him. The prophet said: “You have more rights over him (the son) than his father as long as you don’t remarry.” This implies that if the divorced woman gets married the father has the right to take the child. On the other hand, if the marital ties still exist then both the husband and the wife are responsible for the education of their children. They should share this responsibility. While the man brings food and clothing, the woman takes care of the children at home (cleaning, feeding, etc...) But both of them are responsible for their upbringing, education, and looking after their affairs.
For more benefit on the custody of children, please refer to Fataawa 86891, 87762, 88331, 89832, 182019, and 213352.
Allah knows best.