بِسۡمِ ٱللَّهِ ٱلرَّحۡمَٰنِ ٱلرَّحِيمِ
Anyone who dies in kufr is a Kafir. They should not be washed, have the Funeral Prayer performed for them, or be buried in Muslims' graveyard. In the hereafter, their case is for Allah (Glorified and Exalted be He) to judge. If they are one of those to whom Da`wah (call to Islam) has not reached, they carry the same ruling as Ahl-ul-Fatrah (people having no access to Divine Messages). The evidence for this is drawn from what happened to the Prophet's mother, as she died before she witnessed the era of prophethood. She was of the religion of her people. The Prophet (peace be upon him) asked the Permission of his Lord to seek forgiveness for his mother, but he (peace be upon him) was not permitted to ask forgiveness for her; because she died while embracing the religion of Jahiliyyah (pre-Islamic time of ignorance) and so was his father. When the Prophet (peace be upon him) was asked by some person about his father, he said: Verily, my father and your father are in the Fire. His father died in Jahiliyyah as a follower of the religion of his people, so he was judged to be a Kafir (disbeliever). But anyone who has not received the Da`wah in the life of this world and died ignorant of the truth will be tested on the Day of Resurrection, according to the most correct opinion maintained by scholars. If they succeed (by accepting the truth), they will be admitted into Paradise. But if they oppose the truth, they will be cast into Hellfire.
This applies to all people categorized as Ahl-ul-Fatrah who have not received Da`wah, according to the Words of Allah (Exalted be He): And We never punish until We have sent a Messenger (to give warning).
Regarding those whom the Qur'an or the mission of the Messenger (peace be upon him) has reached but they did not respond, the evidence established against them leaves no excuse for those who reject it. Allah (Glorified and Exalted be He) says: ...this Qur’ân has been revealed to me that I may therewith warn you and whomsoever it may reach. This Ayah (Qur'anic verse) means that whomsoever the Qur'an has reached, they have been warned thereby.
Allah (Exalted be He) says: This (Qur’an) is a Message for mankind (and a clear proof against them), in order that they may be warned thereby Therefore, those to whom the Qur'an and Islam have reached but they did not embrace them, take the ruling of Kafirs. It has been authentically reported that the Prophet (peace be upon him) said: By the One in Whose Hand is my soul, any Jew or Christian of this nation who hears about me and dies unbelieving in what I have been sent with, will be among the dwellers of Hellfire. (Related by Muslim in his Sahih) In this Hadith, the Prophet (peace be upon him) regarded the fact of having heard about his mission as evidence against the hearer (who rejects it).
To sum up, anyone who shows Kufr while being in Muslim lands will come under the same ruling as Kafirs. As to whether or not they shall be saved on the Day of Resurrection, this is up to Allah (Glorified and Exalted be He) Alone. If the person is one of those to whom the Da`wah has not reached or has never heard about the mission of the Messenger (peace be upon him), they will be tested on the Day of Resurrection.
According to a Hadith narrated by Al-Aswad ibn Sari`, a neck-like flame of fire will be presented to them, then it will be said to them: "Get into it." If they comply, the flame of fire will turn into coolness and safety for them. But if they refuse, the flame of fire will coil around them and they will be taken into the Fire. May Allah safeguard us.
In
conclusion, anyone who did not know about the Da`wah whether for having been in the distant outskirts of this world or was born and died before the time of the Da`wah or whoever knew about the Da`wah but was insane, mentally ill or too old to perceive it - they and those like them and the children of the Mushriks who died in their childhood before reaching the age of puberty -
their fate will be in the Hands of Allah. Verily, Allah (Exalted be He) knows well what they would have done (during their life).
That was the answer of the Prophet (peace be upon him) when he was asked about such people. On the Day of Resurrection, Allah (Exalted be He) will make His Knowledge about them evident by testing them. Whoever succeeds will be admitted into Paradise, and whoever fails will be admitted into Hellfire. Indeed, there is neither might nor power except with Allah.
Source:
http://www.alifta.net/Fatawa/fatawaChapters.aspx?languagename=en&View=Page&PageID=11&PageNo=1&BookID=14
Also see:
https://islamqa.info/en/1244