Praise be to Allaah.
If a man or woman is found dead and it is not known whether he was a Muslim or a kaafir, then in this case distinguishing signs should be looked for if possible, such as circumcision in a land where the non-Muslims do not get circumcised, or the type of clothing, or hair dye (e.g. henna), or any sign by which it is possible to find out whether the person was a Muslim or not. If there is no such sign, then the land in which the person died should be taken into account. If it is a Muslim land, then he is deemed to be Muslim and he should be washed (ghusl) and the funeral prayer offered for him. If it is a non-Muslim land, then he should not be washed and the funeral prayer should not be offered for him, because the basic principle is that whoever is in a land is one of its people and comes under the same ruling as them so long as there is no evidence to the contrary.
This is also indicated in a report that is proven in Saheeh al-Bukhaari (3013) and Saheeh Muslim (1745) from Ibn Abbaas (may Allah be pleased with him) from al-Sab ibn Jaththaamah (may Allah be pleased with him) who said: The Prophet (blessings and peace of Allah be upon him) passed by me in al-Liwa' or Waddaan and he was asked whether it was permissible to attack the mushrikeen with the probability of exposing their women and children to danger. He said: They are of them.
Ibn Qudaamah said in al-Mughni (3/478): If a person is found dead and it is not known whether he was a Muslim or a kaafir, they should look for signs such as circumcision, clothing and hair dye. If there are no distinguishing signs and he is in a Muslim country, then he should be washed and the funeral prayer should be offered for him. If he is in a non-Muslim country, then he should not be washed and the funeral prayer should not be offered for him. This was stated by Imam Ahmad because the basic principle is that whoever is in a land is one of its people and comes under the same rulings as them so long as there is no evidence to the contrary. End quote.
Al-Kasaani said in Badaa'i al-Sanaa'i (7/104): The ways in which a person is deemed to be a believer are three: documentary evidence, proofs and implicationâ€¦ With regard to a person being ruled to be Muslim by means of implication, a child may be ruled to be a Muslim by implication if his parents are Muslim, whether he has reached maturity or not. He may also be deemed to be a Muslim because of the land in which he lives. â€¦ End quote.
i.e., if he is found in a Muslim land then he is deemed to be a Muslim; if he is found in a non-Muslim land then he is deemed to be a kaafir.
And Allah knows best.