The Messenger of Allah ﷺ was asked about the children of the polytheists, and he replied, "Allah knows best what they would have done."In another narration, "Those of them who die young."
سئل رسول الله ﷺ عن ذراري المشركين، فقال: الله أعلم بما كانوا عاملين. وفي رواية: من يموت منهم صغيرا.
Bukhari narrated it in the Chapter on Divine Decree (6598), and Muslim in the Chapter on Divine Decree (2659), both from the hadith of Ibn Shihab, from Ata bin Yazid, from Abu Hurairah, and he mentioned it.The second narration, found in Muslim, comes through Sufyan, from Abu Zinad, from Araj, from Abu Hurairah, who said, "The Messenger of Allah ﷺ was asked about the children of the polytheists, those who die while still young." He said, "Allah knows best what they would have done."