Rafi accepted Islam, but his wife refused to do so. She came to the Prophet ﷺ and said, "My daughter, who is just weaned," or something similar.Rafi said, "She is my daughter."The Prophet ﷺ said to him, "Sit on one side."Then he said to her, "Sit on the other side."He placed the little girl between them and said, "Call her."The girl leaned toward her mother. The Prophet ﷺ said, "O Allah, guide her." The girl then turned toward her father, and he took her.
أنه أسلم، وأبت امرأته أن تسلم، فأتت النبي ﷺ فقالت: ابنتي وهي فطيم، أو شبهه، وقال رافع: ابنتي. فقال له النبي ﷺ: اقعد ناحية وقال لها: اقعدي ناحية وأقعد الصبية بينهما، ثم قال: ادعواها فمالت الصبية إلى أمها. فقال النبي ﷺ: اللهم اهدها فمالت إلى أبيها فأخذها.
This was reported by Abu Dawud (2244), Ahmad (2375), Hakim (2/206), and from him Bayhaqi (3/8), all of them through various chains from Isa bin Yunus, who said, "Abdul-Hameed bin Jafar informed us, my grandfather Rafi bin Sinan told me," and then he mentioned the hadith.His statement "my grandfather" refers to his grandfather's grandfather, since he is Abdul-Hameed bin Jafar bin Abdullah bin Hakam bin Rafi bin Sinan. This has been made explicit in the narration of Daraqutni (4/43), where he said, "from Abdul-Hameed bin Jafar Ansari, my father told me, from his grandfather's grandfather Rafi bin Sinan." In one narration, it states that his grandfather Rafi bin Sinan embraced Islam while his wife refused. Hakim graded it sahih.As for what Uthman Batti reported, from Abdul-Hameed bin Salama, from his father, from his grandfather, that his parents disputed over him before the Prophet ﷺ, one being a Muslim and the other a disbeliever, and then he mentioned the hadith, this contains an error on the part of Uthman Batti, as Daraqutni and others have stated. Nasai (3495), Ahmad (23755), and others reported it through this chain as well.The hadith has other chains that are defective, but they do not affect the soundness of what has already been established as sahih. The practice has been abrogated by this hadith, for when one of the two spouses embraces Islam and the other does not, the child always belongs to whichever parent embraced Islam, so that the child is not led astray by disbelief. This is the position held by Shafii. The people of legal reasoning, however, held that the mother has greater right to the child so long as she has not remarried, whether she is a dhimmi or a Muslim.