Child Custody When Mother Remarries
Question

I divorced my husband (through khula issued by a group of Imams in our community as my ex-husband was refusing to accept the khula due to his difficult personality). The reason why I asked for the khula was because he refused to financially support me or our daughter and was very negligent towards us. My daughter was less than one year old at the time. For one year, the Imams tried to negotiate a contract with him, but because he is argumentative and very unreasonable, the Imams encouraged me to go to American court so that I could get some financial support for our daughter. I despised going to the American court, but I really felt that I had no other options. I only take what is Islamically reasonable in terms of money for my daughter from my ex-husband. We have a visitation schedule in place, but he only spends minimal time with her and makes very little effort to establish a good relationship with her.
My daughter is now 7 years old and has always lived with me and my parents. I would like to re-marry and have a question about custody. I know that once a woman remarries, she loses custody of her child. However, my daughter is now 7 years old and old enough to say who she wants to be with. I know there is a difference of opinion as to who can “sponsor” her, but if she really wants to live with me, can she continue to do so after I remarry. Please note that the man I would like to remarry has absolutely no problems with helping me raise her. Also, although my ex-husband is Sunni Muslim, his entire family is either non-Muslim or Shi`ah. Given that I know my ex-husband tends to be negligent, I don’t want to put my young daughter in an un-Islamic environment.
In the event that I do lose primary custody of my daughter, could my mother “sponsor” her. Also, what happens after the age of puberty? Can she then come back to live with me?.
Praise be to Allah.Mother’s Custody Rights until Age Seven
The mother has more right to custody of her children until the age of seven, so long as she has not remarried , because of the report narrated by Ahmad (6707) and Abu Dawud (2276), from `Abdullah ibn `Amr (may Allah be pleased with him), according to which a woman said: O Messenger of Allah, this is my son; my womb was a vessel for him, and my breasts gave him to drink, and my lap was a protection for him. His father has divorced me and he wants to take him away from me. The Messenger of Allah (blessings and peace of Allah be upon him) said: “You have more right to him so long as you do not remarry.”
This Hadith was classed as sound by Al-Albani in Sahih Abu Dawud.
Custody Transition upon Mother’s Remarriage
If she remarries, custody passes to the one who comes after her . There is a difference of opinion among the jurists concerning that. Some of them think that it passes to the maternal grandmother and this is the opinion of the majority of the four Madhhabs.
Some think that it passes to the father, and this is the view favoured by Shaykh Al-Islam Ibn Taymiyah and Ibn Al-Qayyim (may Allah have mercy on them). (Al-Masu`ah Al-Fiqhiyyah, 17/303; Ash-Sharh Al-Mumti`, 13/535)
It says in Zad Al-Mustaqni`: The one who is most entitled to it (custody) is the mother , then her foremothers, the closest then the next closest, then the father, then his foremothers in like manner, then the grandfather, then his foremothers in like manner…
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said in his commentary: This sequence that was mentioned by the author is not based on any foundation of evidence and there is no rational explanation for it, and there are some contradictions in it that make one feel uneasy about it. Hence the scholars differed concerning the sequence of (who is entitled to) custody and there are several opinions, but none of them has any reliable basis.
Hence Shaykh Al-Islam (may Allah have mercy on him) was of the view that custody should go to the one who is most closely related , whether that is the father or mother, or on the father’s side or on the mother’s side; if they are equal, then priority should be given to the female. If there are two males or two females then lots may be drawn, otherwise the father’s side takes precedence. (End quote from Ash-Sharh Al-Mumti`, 13/535)
However, even though the father may take precedence over the maternal grandmother, it is still essential to examine the father’s situation and how suitable and able he is to raise the child. If he is corrupt or incapable of raising the child, then custody passes to someone else. These are matters that should be solved through the intervention of good and righteous people in order to choose what is best for the child and less harmful to both the husband and wife.
Custody Options for Children over Seven
If the mother has not remarried and the child has reached the age of seven years:

If the child is a male, he should be given the choice between his father and mother, and then live with the one he chose, because of the report narrated by An-Nasa’i (3496) and Abu Dawud (2277), according to which a woman came to the Messenger of Allah (blessings and peace of Allah be upon him) and said: May my father and mother be sacrificed for you. My husband wants to take my son away even though he benefits me and brings me water from the well of Abu `Anbah. Her husband came and said: Who is disputing with me concerning my son? [The Prophet (blessings and peace of Allah be upon him)] said: “O boy, this is your father and this is your mother, take the hand of whichever of them you want.” And he took his mother’s hand and she went away with him.

This Hadith was classed as authentic by Al-Albani in Sahih Abu Dawud. This is the opinion of the Hanbalis and Shafi`is

If the child is female, then she is also to be given the choice according to Ash-Shafi`i (may Allah have mercy on him).

Abu Hanifah said: The mother is more entitled to custody until the girl gets married or starts to menstruate.
Malik said: The mother is more entitled to custody until she gets married and the husband consummates the marriage with her.
Ahmad said: The father is more entitled to custody, because it is more appropriate for the father to take care of her. (End quote from Al-Mawsu`ah Al-Fiqhiyyah, 17/314-317)
Custody Options for Mature Children
If the child has reached the age of maturity that he may choose whichever of his parents he wants.
Ibn Qudamah (may Allah have mercy on him) said:
There is no proof of custody except in the case of a child or one who has a disability . As for the adult of sound mind, there is no custody of him and he has the choice of staying with whichever of his parents he wants, and if he is a man he has the option of staying alone and being independent of both of them. But it is not recommended for him to stay away from both of them or to stop honouring them. If the child is a girl then she has no option of staying alone and her parents have the right to prevent her from doing that, because there is no guarantee that she will be safe from someone who will enter upon her and do her harm and bring shame upon her and her family; if she has no father than her guardian and family have the right to prevent her from doing that. (End quote from Al-Mughni, 8/191)
And Allah knows best.