Abdullah bin Abbas reported,

The Messenger of Allah ﷺ was asked about the children of the polytheists, and he said, "Allah knows best what they would have done."In another narration, "Allah, when He created them, knew best what they would have done."

Azami 1084

Sahih

عن ابن عباس، قال

سئل رسول الله ﷺ عن أولاد المشركين فقال: الله أعلم بما كانوا عاملين. وفي رواية: الله إذ خلقهم أعلم بما كانوا عاملين.

الأعظمي 1084صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
Prophet ﷺ was asked about the offspring of the polytheists in the Hereafter and he said, "Allah knows best what they would have done"
Numbering
Jami al-Kamil 1084 (2nd edition)
Azami 1084