His parents brought a dispute before the Prophet ﷺ, one of them being a disbeliever and the other a Muslim. The Prophet ﷺ gave the child the choice. The child turned toward the disbeliever, so the Prophet ﷺ said, "O Allah, guide him." The child then turned toward the Muslim, and the Prophet ﷺ ruled in his favor.
حدثنا أبو بكر بن أبي شيبة حدثنا إسمعيل ابن علية عن عثمان البتي
أن أبويه اختصما إلى النبي ﷺ أحدهما كافر والآخر مسلم فخيره فتوجه إلى الكافر فقال اللهم اهده فتوجه إلى المسلم فقضى له به
[Hasan] Narrated by Nasai, 6/185, Talaq (Divorce) chapter on one of the spouses embracing Islam and the child's choice, hadith no. 3525, from the hadith of Uthman Batti, with this wording. Busiri said, "This isnad is daif. Abdul-Hameed, his father, and his grandfather are unknown."Narrated by Abu Dawud, hadith no. 2244, from the hadith of Abdul-Hameed bin Jafar (bin Abdullah bin Hakam bin Rafi Ansari), from his father, from his grandfather Rafi bin Sinan, with this wording. Hakim graded it sahih in 2/206, 207, and Dhahabi agreed with him. Its isnad is sahih if Jafar's hearing from his maternal grandfather Rafi is established. And Allah knows best.