Praise be to Allah.
Part of the justice and mercy of Allah, may He be exalted, towards His slaves is that He does not punish anyone except after proof has been established against him.
Allah, may He be exalted, says (interpretation of the meaning):
“And never would We punish until We sent a messenger”
It was narrated from Abu Hurayrah, from the Messenger of Allah (blessings and peace of Allah be upon him), that he said: “By the One in Whose hand is the soul of Muhammad, no one of this nation, Jew or Christian, hears of me then dies without having believed in that with which I was sent, but he will be one of the people of the Fire.” Narrated by Muslim (240).
An-Nawawi (may Allah have mercy on him) said:
From this it may be understood that whoever was not reached by the call of Islam will be excused.
End quote from Sharh Saheeh Muslim (2/188).
Just as it is part of the justice and mercy of Allah, may He be exalted, that He does not punish those who were not reached by the call of Islam, so too He has decreed that no one will enter Paradise except a Muslim soul, as it was narrated soundly from the Prophet (blessings and peace of Allah be upon him) that he said: “Verily no one will enter Paradise except a Muslim soul.” Narrated by al-Bukhaari (3062) and Muslim (111).
Based on that, what will be the situation of the disbeliever on the Day of Resurrection, if the call had not reached him?
The answer is that the Sunnah provides an explanation of the situation of these people, and tells us that Allah will test them on the Day of Resurrection; whoever obeys will enter Paradise and whoever disobeys will enter Hell.
It was narrated from al-Aswad ibn Saree‘ that the Prophet of Allah (blessings and peace of Allah be upon him) said: “There are four (who will protest) to Allah on the Day of Resurrection: the deaf man who never heard anything, the insane man, the very old man, and the man who died during a fatrah (the interval between two Prophets). The deaf man will say, ‘O Lord, Islam came but I never heard anything.’ The insane man will say, ‘O Lord, Islam came but the children ran after me and threw stones at me.’ The very old man will say, ‘O Lord, Islam came but I did not understand anything.’ The man who died during the fatrah will say, ‘O Lord, no Messenger from You came to me.’ He will accept their promises of obedience, then word will be sent to them to enter the Fire. By the One in Whose hand is the soul of Muhammad, if they enter it, it will be cool and safe for them.”
Narrated by Ahmad in al-Musnad (26/228).
A similar report was also narrated from Abu Hurayrah, except that he said at the end: “… whoever enters it, it will be cool and safe for him, and whoever does not enter it will be dragged to it.” Al-Musnad (26/230).
Ibn al-Qayyim (may Allah have mercy on him) said: There are many hadiths regarding this matter, to the extent that they support one another. The scholars classed some of them as saheeh, such as al-Bayhaqi, ‘Abd al-Haqq and others, who classed the hadith of al-Aswad ibn Saree‘ as saheeh.
The isnad of the hadith of Abu Hurayrah is saheeh and complete. End quote from Ahkaam Ahl adh-Dhimmah (2/1149).
Ibn Katheer (may Allah have mercy on him) said:
With regard to the hadiths which speak of this matter, some of them are saheeh, as more than one of the leading scholars have stated; some of them are hasan, and some are da‘eef (weak) but are strengthened by the saheeh and hasan reports.
When the hadiths on a particular topic support one another to this extent, this is regarded as proof concerning that topic.
End quote from Tafseer Ibn Katheer (5/58).
Ibn Hajar (may Allah have mercy on him) said:
The issue of testing in the case of the insane and those who died during a fatrah (interval between two Prophets) is proven to be sound via saheeh isnaads. End quote.
Fath al-Baari (3/246).
It was also classed as saheeh by al-Albaani in Silsilat al-Ahaadeeth as-Saheehah (3/418-419).
This view was regarded as more likely to be correct by many of the well-versed scholars such as Shaykh al-Islam Ibn Taymiyah in al-Jawaab as-Saheeh (2/298); Ibn al-Qayyim in Ahkaam Ahl adh-Dhimmah (2/1137); Ibn Katheer in Tafseer Ibn Katheer (5/58); and others.
This ruling is to be understood in general terms, without stating definitively concerning any particular individual that he is excused, or that he will be tested on the Day of Resurrection, or not.
Ibn al-Qayyim (may Allah have mercy on him) said:
Allah will judge between His slaves on the Day of Resurrection by His wisdom and justice, and He will not punish anyone except those against whom proof is established through the Messengers. This category of people will definitely be dealt with in that manner.
But as for the question of whether or not proof is established against any particular individual, this is a matter to be decided by Allah and we cannot issue rulings concerning specific individuals in that regard. Rather what is required is to believe that everyone who follows a religion other than Islam is a disbeliever, and that Allah, may He be glorified and exalted, does not punish anyone except after proof has been established against him through the Messenger. This is in general terms; with regard to specific individuals, the matter is left to the knowledge and judgement of Allah, may He be glorified and exalted.
End quote from Tareeq al-Hijratayn (2/900).
With regard to the Muslim who believes in Islam and adheres to it both outwardly and inwardly, but he goes astray in some issues because of ignorance as there is no one to explain the truth to him, and he does not have the ability to realise that the wrong idea he is following is false, he is a Muslim in principle, and cannot be regarded as being beyond the pale of Islam without being certain that proof has been established against him and he has no excuse after coming to know the truth.
So he is excused in this world, as he will be excused in the hereafter, because Allah does not punish anyone except one whom the truth reached, then he turned away from it.
See the answers to questions no. 111362 and 104412 for further details on this point.
And Allah knows best.