Sahih al-Bukhari 1248
Sahih al-Bukhari · Book 23: Funerals (Al-Janaa'iz) · The superiority of the person whose child dies
Narrated Anas:
حَدَّثَنَا أَبُو مَعْمَرٍ ، حَدَّثَنَا عَبْدُ الْوَارِثِ ، حَدَّثَنَا عَبْدُ الْعَزِيزِ ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم " مَا مِنَ النَّاسِ مِنْ مُسْلِمٍ يُتَوَفَّى لَهُ ثَلاَثٌ لَمْ يَبْلُغُوا الْحِنْثَ، إِلاَّ أَدْخَلَهُ اللَّهُ الْجَنَّةَ بِفَضْلِ رَحْمَتِهِ إِيَّاهُمْ " .
The Prophet (ﷺ) said, "A Muslim whose three children die before the age of puberty will be granted Paradise by Allah due to his mercy for them."