Sahih al-Bukhari 6750
Sahih al-Bukhari · Book 85: Laws of Inheritance (Al-Faraa'id) · The child is for the owner of the bed
Narrated Abu Huraira:
حَدَّثَنَا مُسَدَّدٌ ، عَنْ يَحْيَى ، عَنْ شُعْبَةَ ، عَنْ مُحَمَّدِ بْنِ زِيَادٍ ، أَنَّهُ سَمِعَ أَبَا هُرَيْرَةَ ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " الْوَلَدُ لِصَاحِبِ الْفِرَاشِ " .
The Prophet (ﷺ) said, "The boy is for the owner of the bed."