Praise be to Allah.
The Muslim is obliged to learn those rulings of sharee‘ah that he needs to know and cannot do without, such as the rulings on purification, prayer and so on, and before all of that he needs to know about the Oneness of Allah (Tawheed), even if that is in general terms, and to know that which nullifies Tawheed and faith, so that he will worship Allah, may He be exalted, on the basis of knowledge.
Fathers and mothers must teach their children what they need to know of Islamic rulings, including the purification and prayer.
This is one of the rights that children have over their parents.
If a person is unaware of the rulings on purification, and he prays with invalid purification out of ignorance on his part, then there is no sin on him and he does not have to make up those prayers that he offered with imperfect purification.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
Based on that, if a person does not purify himself as he is obliged to because the text did not reach him, such as if he eats camel meat and does not do wudoo’ after that, then the text reaches him and it becomes clear to him that wudoo’ is required in this case, or he prays in the camel pens, then the text reaches him and the ruling becomes clear to him, does he have to repeat his past prayers? There are two scholarly opinions, both of which were narrated from Ahmad.
A similar case is if he touches his penis then prays, then it becomes clear to him that it is obligatory to do wudoo’ after touching one’s penis.
The correct view in all these cases is that he does not have to repeat the prayers, because Allah pardons things done by mistake or because of forgetting, and because He says (interpretation of the meaning): “And We never punish until We have sent a Messenger (to give warning)” [al-Isra’ 17:15].
If the command of the Messenger (blessings and peace of Allah be upon him) concerning a particular matter did not reach a person, then the ruling that it is obligatory was not proven in his case. Hence in the case of ‘Umar and ‘Ammaar, when they became junub and ‘Umar did not pray whilst ‘Ammaar did pray after rolling in the dust, the Prophet (blessings and peace of Allah be upon him) did not instruct either of them to repeat the prayer. Similarly, he did not instruct Abu Dharr to repeat the prayer when he used to become junub and remained for several days without praying. And he did not instruct the Companion who ate until he could clearly distinguish the white thread from the black thread to make up the fast. And he did not instruct those who prayed facing towards Jerusalem before news reached them that this ruling (of facing Jerusalem when praying) had been abrogated to make up those prayers.
A similar case is that of the woman who was suffering from istihaadah (irregular, non-menstrual bleeding) and did not pray for a while because she thought that prayer was not obligatory in her case. There are two scholarly views as to whether she is obliged to make up the prayers. The first view is that she is not required to do so – as was narrated from Maalik and others – because when the woman who was suffering from istihaadah said to the Prophet (blessings and peace of Allah be upon him): I bleed very heavily and that has kept me from praying and fasting, he told her what she had to do in the future, but he did not instruct her to make up prayers from the past.
It is proven to me through the mutawaatir reports that among women and men in the desert and elsewhere there are those who reach the age of puberty and are not aware that prayer is obligatory for them. In fact, if a woman is told to pray, she says, Not until I am older and become an old woman! – thinking that prayer is only obligatory for old women and the like. Among the followers of the shaykhs (i.e., Sufis) there are many groups who do not know that prayer is obligatory for them. In these cases they are not required to make up the missed prayers, according to the correct opinion. End quote.
Majmoo‘ al-Fataawa (21/101, 102)
And Allah knows best.