Jami` at-Tirmidhi, Hadith 2138 ⓘ
'Abu Hurairah narrated that the Messenger of Allah (s.a.w) said: "Every child is born upon the Millah, then his parents make him a Jew, a Christian, or a idolater." It was said: "O Messenger of Allah! What about those who die before that?" He said: "Allah knows best what they would have done."
حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى الْقُطَعِيُّ الْبَصْرِيُّ، حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ رَبِيعَةَ الْبُنَانِيُّ، حَدَّثَنَا الأَعْمَشُ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " كُلُّ مَوْلُودٍ يُولَدُ عَلَى الْمِلَّةِ فَأَبَوَاهُ يُهَوِّدَانِهِ أَوْ يُنَصِّرَانِهِ أَوْ يُشَرِّكَانِهِ " . قِيلَ يَا رَسُولَ اللَّهِ فَمَنْ هَلَكَ قَبْلَ ذَلِكَ قَالَ " اللَّهُ أَعْلَمُ بِمَا كَانُوا عَامِلِينَ بِهِ " .
also referenced under: Book 32, Hadith 2287 (In-Book) & Volume 4, Book 30, Hadith 2138 (DarusSalam)