Praise be to Allah.
Whoever believes in Allah, may He be exalted, and in His Messenger (blessings and peace of Allah be upon him), and adheres to the rulings of Islam, obeys Allah and submits to Him, and does not fall into any area of disbelief or shirk, is a believer and will be saved, and it will not matter that he is unaware of some actions that constitute disbelief or shirk, or he is unaware that the one who denies that which he believes to be definitively proven is a disbeliever. It is not a condition of sound faith that one should know about what constitutes disbelief in detail. So long as Allah has protected him from that, then he is a believer who affirms the oneness of Allah. In fact, even if he falls into something of that out of ignorance, the correct view is that he does not become a disbeliever thereby; rather he is excused because of his ignorance, as has been explained previously in many answers on our website. The difference of scholarly opinion concerning this matter is well known.
The soundness of what we have said above is indicated by what happened to some of the Sahaabah (may Allah be pleased with them), who fell into that which may be regarded as contrary to Tawheed out of ignorance on their part concerning that. At-Tirmidhi (2180) and Ahmad (21897) narrated from Abu Waaqid al-Laythi that when the Messenger of Allah (blessings and peace of Allah be upon him) set out for Hunayn, he passed by a tree of the polytheists which was called Dhaat Anwaat, on which they used to hang their weapons. They said: O Messenger of Allah, make for us a dhaat anwaat as they have a dhaat anwaat. The Prophet (blessings and peace of Allah be upon him) said: “Subhaan-Allah! This is like when the people of Moosa said: ‘make for us a god just as they have gods’ [al-A‘raaf 7:138]. By the One in Whose hand is my soul, you will certainly follow in the footsteps of those who came before you.” Classed as saheeh by al-Albaani and Shu‘ayb al-Arna’oot.
Imam Muhammad ibn ‘Abd al-Wahhaab (may Allah have mercy on him) said in Kitaab at-Tawheed, regarding what we learn from this story:
…5. If they [the Sahaabah] were unaware of this, then others are more likely to be unaware of it… 9. The fact that what they asked for was contrary to the meaning of Laa ilaaha ill-Allah was something that was not clear to them.
End quote from Kitaab at-Tawheed.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said in his commentary: “the fact that this was contrary to the meaning of Laa ilaaha ill-Allah was something that was not clear to them” means that the fact that seeking blessing from trees and the like was contrary to the meaning of Laa ilaaha ill-Allah. That is because Laa ilaaha ill-Allah is denying that anything can be worthy of worship except Allah, and is denying that anyone or anything can be divine except Allah, may He be glorified and exalted, and thus blessing cannot be sought from any except Allah, may He be blessed and exalted.
End quote from al-Qawl al-Mufeed Sharh Kitaab at-Tawheed (1/205).
Similar to this is the case of one who does all the essential and obligatory parts of the prayer, and does not do anything to render his prayer invalid. His prayer is valid, even if he is unaware of what is a rukn (an essential part) and what is waajib (an obligatory part), or he does not know what renders the prayer invalid.
It says in al-Mubdi‘ (1/445): Whoever prays, believing that prayer is obligatory, and does the actions of a valid prayer, some of which are fard (obligatory) and some are naafil (supererogatory), and he is not aware of what is fard and what is Sunnah, or he believes that everything is fard, his prayer is valid, according to scholarly consensus. End quote.
It says in Kashshaaf al-Qinaa‘ (1/393): If the worshipper believes that something fard is Sunnah, or vice versa – meaning that he believes that something Sunnah is fard – or he does not think about the matter or whether anything is fard or Sunnah, and he offers the prayer as described above, which includes all the conditions, essential parts and obligatory parts, and he knows that all of that is part of the prayer, but he does not know what is a condition or what is essential, his prayer is valid.
Abu’l-Khattaab said: It does not matter if he does not know what is an essential part and what is a condition, what is fard and what is Sunnah. Al-Majd refuted the one who said that it is not valid to pray behind someone who believes that reciting al-Faatihah is naafil; his refutation was based on the attitude of the Sahaabah and those who came after them, despite the fact that they differed greatly with regard to what is fard and what is Sunnah [in the prayer]. If someone prays, believing that the prayer is obligatory, and does the appropriate actions that render the prayer as sound – some of which are fard and some are naafil, and he does not know what is fard and what is Sunnah, or he believes that all of it is fard – his prayer is valid, according to scholarly consensus. This was stated in al-Mubdi‘. End quote.
The same applies here: if someone believes and has faith, and does not do anything to invalidate his faith, then his faith is sound and it does not matter whether he knows what is an essential part or an obligatory part, or what is definitive or otherwise.
And Allah knows best.