Sunan an-Nasa'i
It was narrated that Abu Hurairah said: "The Messenger of Allah (ﷺ) was asked about the children of the idolators and he said: 'Allah knows best what they would have done."'
أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ الْمُبَارَكِ، قَالَ حَدَّثَنَا الأَسْوَدُ بْنُ عَامِرٍ، قَالَ حَدَّثَنَا حَمَّادٌ، عَنْ قَيْسٍ، - هُوَ ابْنُ سَعْدٍ - عَنْ طَاوُسٍ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم سُئِلَ عَنْ أَوْلاَدِ الْمُشْرِكِينَ فَقَالَ " اللَّهُ أَعْلَمُ بِمَا كَانُوا عَامِلِينَ " .
Grade: Sahih (Darussalam)
Reference