The Vizier said, “There is consensus that custody belongs to the mother so long as she has not remarried.
They also agree that if she marries and the marriage is consummated, her right to custody lapses; but if she is later divorced with an irrevocable divorce, her right returns.”
Shaykh al-Islām said, “The mother is more suitable than the father, for she is gentler with the child, more familiar with rearing him, carrying him, and putting him to sleep; she is more patient with him and more compassionate toward him. Accordingly, in this situation she is the more capable, compassionate, and patient, and the Law therefore assigns the custody of the pre-discerning child exclusively to her.
As a general rule, women are given precedence over men in matters of custody, just as the mother is preferred to the father. On that basis, his sisters are preferred to his brothers, his paternal aunts to his paternal uncles, and his maternal aunts to his maternal uncles—that is the sound analogy.
It should also be understood that the Lawgiver has laid down no universal text preferring either parent, nor a general provision for allowing the child to choose between them. The scholars agree that neither parent is categorically designated; rather, precedence is given to whichever of them secures the benefit of custody and wards off its harm. If one of them is morally deficient, the other is unquestionably given priority.”
The compiler adds, “The fact of the matter is that custody is a form of guardianship and may be exercised only by the person best qualified for it. Qualification is determined by one’s ability to attend to the child’s needs. The Sharīʿah does not give precedence merely on the basis of kinship; it gives precedence to the one who is more deserving, more capable, and better suited to the task. This is what the scholars meant, whatever differences there may be in their wording or ordering. Allah knows best.”