The question has two parts, and the answer will be given accordingly 1) Muslim Children dying before the age of puberty and maturity.
2) Non-Muslim Children dying before the age of puberty and maturity.
1) Muslim Children who die before reaching the age of puberty and maturity enter Jannah. The Masnoon Du’a recited in the funeral prayers for Muslim Children also indicate towards this.
2) There is much controversy amongst the Theologians regarding the fate of the Non-Muslim Child dying before the age of puberty and maturity. Firstly, I would like to cite a Hadith on this issue. Abu Hurairah Radiallahu anhu narrates that Rasoolullah Sallallahu alaihi wasallam was once asked: ‘ What will be the fate of the Children of the Polytheists (or non-believers in general, ie the children that die before reaching the age of puberty and maturity)’? Rasoolullah Sallahu alaihi wasallam Sallallahu alaihi wasallam replied: ‘ Allah knows best as to what actions they would have committed in their lives.’
Mulla Ali Qari, the famous Hanafi Commentator on the Hadith compilation, Mishkaat al-Masabeeh, writes in Mirqaat: The Ulamaa have different stances, views and positions in regards to this matter:
1) According to some, they will enter Jahannam, just as their parents would. As followers of parents, they would also enter the hell-fire.
2) They will be from amongst the dwellers of Jannah (paradise) according to the nature of Islam that every child is created upon. In the famous Hadith, Rasoolullah Sallahu alaihi wasallam has said: ‘ Every born child is created upon the fitrah (natural religion of Islam in which there is inclination to Tawhid, the oneness of Allah). Thereafter, his/her parents make him Jew, Chistian or a Fire-Worshipper.’
From this Hadith we learn that every child is born Muslim, so according to it, if a child dies before reaching the age of understanding, then he should be granted entry into Paradise. Hafiz Ibn Hajar, one of the leading Hadith Scholars of all tme is inclined towards this view. He states: ‘ The Hadith mentioned above was narrated by the Prophet before anything concrete was revealed to him about the dying children of the non-believers. This is why the Prophet left it to Allah’s knowledge and didn’t make a judgement.
3) Some say that they will not be granted entry into Paradise as one of the eligible dwellers, but instead they will be the servants of the People of Jannah in their palaces.
4) Some Scholars say that they will be in a place between Jannah and Jahannam, neither will they be favoured and rewarded like the Jannah dwellers, nor punished like those doomed for hell.
5) Some say, that if according to Allahs knowledge, the dying child would have grown up to be a believer and a pious man, then he will enter Janah, and if he would have grown up to be a sinner and disbeliever, then he will enter Jahannam.
6) The majority of the Ahl-ussunnah are of the view that we must practise Tawaqquf ( cautiousness) in this issue. We should leave it to Allah without making any judgements. No concrete judgement is recorded from the Prophet, so we should leave it at that instead of making calculations through analogy. This is the most cautious and preferred view and is also concluded from the above-mentioned Hadith.
And Allah knows best.
Mufti Yaseen Shaikh