His parents brought a dispute over him before the Prophet ﷺ, one of them being a Muslim and the other a disbeliever. The Prophet ﷺ gave the child the choice. The boy turned toward the disbelieving parent, so the Prophet ﷺ said, "O Allah, guide him." The boy then turned toward the Muslim parent, and the Prophet ﷺ ruled in his favor.
حدثنا إسماعيل عن عثمان البتي
أن أبويه اختصما فيه إلى النبي ﷺ وأحدهما مسلم والآخر كافر فخيره فتوجه إلى الكافر منهما فقال اللهم اهده فتوجه إلى المسلم فقضى له به
Its chain is sahih, according to the correction we have mentioned, and Abdul-Hameed bin Jafar bin Abdullah is trustworthy, he and his father, and their hadith is found in Muslim. But Daraqutni said, Abdul-Hameed bin Salama and his father and his grandfather are unknown. The hadith is also found in Nasai 6/185 number 3495, and Ibn Majah 2/788 number 2352, both of them by way of Abdul-Hameed, from him, with the same wording. Busiri quoted Daraqutni's statement. And Saeed bin Mansur has it in his Sunan 2/110 number 2276, but it is sahih in Tali Talkhisih.