Custody
3 hadiths
You are more entitled to him as long as you do not get married
‘Abdullāh ibn ‘Amr reported that a woman said: "O Messenger of Allah, for this son of mine, my womb was a vessel, my breast was a watering pot, and my lap was a holder, yet his father has divorced me and wants to take him away from me." The Messenger of Allah (may Allah's peace and blessings be upon him) said: 'You are more entitled to him (the child's custody) as long as you do not get married.''
This is your father, and this your mother, so take whichever of them you wish by the hand
Abu Maymūnah Salma, who was a truthful man and a freed slave from among the people of Madīnah, reported: While I was sitting with Abu Hurayrah, a Persian woman came to him along with a son of hers. She had been divorced by her husband, and they both (the father and mother) claimed him. She said: "O Abu Hurayrah," speaking to him in Persian, "my husband wants to take my son away." So Abu Hurayrah said: "Draw lots on this," saying it to her in Persian. Then her husband came and said: "Who is disputing with me regarding my son?" Abu Hurayrah said: "O Allah, I do not say this, except that I heard a woman who came to the Messenger of Allah (may Allah's peace and blessings be upon him) while I was sitting with him, and she said: ‘My husband wants to take away my son, Messenger of Allah, and my son draws water for me from the well of Abu ‘Inabah, and he has been helpful to me.’ The Messenger of Allah (may Allah's peace and blessings be upon him) said: ‘Cast lots for him.’ Her husband said: ‘Who is disputing my son with me?’ The Prophet (may Allah's peace and blessings be upon him) said: ‘This is your father, and this your mother, so take whichever of them you wish by the hand.’ So he took his mother's hand, and she went away with him.'"
Hadīth of Rāfi‘ ibn Sinān about giving a child the option to choose between parents who separated upon conversion to Islam
Rāfi‘ ibn Sinān (may Allah be pleased with him) reported: I embraced Islam, but my wife refused to do so. She went to the Prophet (may Allah's peace and blessings be upon him) and said: "My daughter is weaned or about to be weaned." Rāfi‘ said: "My daughter." The Prophet (may Allah's peace and blessings be upon him) said to the man: "Sit down on this side." And he said to the woman: "Sit down on that side." He then seated the girl between them, and said to them: "Call her." The girl went to her mother and the Prophet (may Allah's peace and blessings be upon him) said: ‘'O Allah, guide her," and the daughter then went to her father, who took her.