The Messenger of Allah ﷺ said, "No Muslim who loses three children will be touched by the Fire, except for the brief moment that fulfills the oath."
حدثنا قتيبة عن مالك بن أنس ح و حدثنا الأنصاري حدثنا معن حدثنا مالك بن أنس عن ابن شهاب عن سعيد بن المسيب
أن رسول الله ﷺ قال لا يموت لأحد من المسلمين ثلاثة من الولد فتمسه النار إلا تحلة القسم
Agreed upon (by Bukhari and Muslim). Muslim narrated it in the Book of Righteousness and Kinship Ties, chapter on the merit of one whose child dies and he bears it patiently, hadith no. 2632, and Bukhari, hadith no. 6656, from the hadith of Malik, and it is in the Muwatta, 1/235.There are also narrations on this subject from Umar [Ibn Adi in Kamil, 7/2716], Muaz [Ibn Majah, hadith no. 1603], Kaab bin Malik [I did not find it], Utba bin Abd [Ibn Majah, hadith no. 1604], Umm Salim [Ahmad, 6/431, and Bukhari in Adab al-Mufrad, hadith no. 149], Jabir [Ahmad, 3/306, and Bukhari in Adab al-Mufrad, hadith no. 146], Anas [Bukhari, hadith no. 1248], Abu Dharr [Nasai, hadith no. 1875], Ibn Masud [to come, no. 1061], Abu Thalaba Ashjai [Ahmad, 6/396], Ibn Abbas [to come, no. 1062], Uqba bin Amir [Ahmad, 4/144, and Bukhari, hadith no. 101, and Muslim, hadith no. 2633], Qurra bin Iyas Muzani [Ahmad, 5/350, and Nasai, hadith nos. 1871 and 2090], and Abu Saeed.