It is narrated from Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) was asked about the offspring of the polytheists (who die in childhood), and he (peace and blessings be upon him) said: "Allah knows best the deeds they would have done (had they grown up)."
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب العلم / 231
Hadith Gradingمحدثین:إسناده ضعيف؛ لضعف أبي هارون العبدي، والمتن صحيح
Hadith Takhrij«أخرجه صحيح البخاري برقم: 1317، وأخرجه صحيح مسلم برقم: 2660، وأخرجه سنن النسائي برقم: 1951، وأخرجه سنن أبي داود برقم: 4711، وأخرجه مسند أحمد برقم: 1848، 3026، 3155، 3357، وأخرجه المستدرك على الصحيحين برقم: 3451»