It is narrated from Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) gave a boy the choice to select either his father or his mother.
Hadith Referenceمسند الإمام الشافعي / كتاب عشرة النساء والإيلاء والخلع / 1220
Hadith Takhrijاخرجه الترمذى، الأحكام، باب ما جاء فى تخيير الغلام بين ابويه اذا افترقا (1357) - وقال ”حسن صحیح“۔ وابن ماجة، الأحكام، باب تخيير الصبى بين ابویه (2351) والنسائی، الطلاق، باب اسلام أحد الزوجين وتخيير الولد (3526) - وصححه الحاكم: 4/ 97 - وابن حبان۔
Yunus bin Abdullah Al-Jarmi narrated that Ali (may Allah be pleased with him) gave me the choice to choose between my mother and my uncle, then regarding my younger brother he said: "He would also have the same choice if he had reached his (i.e., my) age."
Hadith Referenceمسند الإمام الشافعي / كتاب عشرة النساء والإيلاء والخلع / 1221
Hadith Takhrijاسناده ضعيف لجهالة الجرمي اخرجه البيهقي: 8/4 - وفي المعرفة السنن والآثار له (4772)۔
It is narrated from Ali (may Allah be pleased with him) through the chain of Yunus, from ‘Ammarah, similarly, and in this hadith it is stated: "At that time, I was seven or eight years old."
Hadith Referenceمسند الإمام الشافعي / كتاب عشرة النساء والإيلاء والخلع / 1222
Hadith Takhrijاسناده ضعيف جدا لضعف شيخ الشافعى ولجهاله عمارة الجرمي انظر تخريج الحديث الذي قبله، برقم : (1221)۔