The conditions for prayer are nine : Islam, reason, discernment, removing impurity, removing impurity, covering the private parts, entering the time, facing the Qiblah, and making the intention.
(1)The first condition: Islam, and its opposite is disbelief, and the deed of the disbeliever will be rejected, even if he does any deed, and the evidence is the Almighty’s saying: “It is not for the polytheists to inhabit the mosques of God, witnessing against themselves in disbelief. Such are their deeds And in the Fire they will abide forever” [At-Tawbah: 17], and His saying: God Almighty: {And We will turn to what they have done of deeds and make them as dust scattered} [Al-Furqan: 23].
(2) The second condition: Reason , and its opposite is insanity, and the pen is lifted from the insane until he awakens, and the evidence is the hadith: “The pen is lifted from three: the sleeping person until he awakens, the insane until he awakens, and the minor until he reaches puberty.”
(3) The third condition: discrimination, and its opposite is young age, which alone is seven years, then he is ordered to pray;According to what he, may God’s prayers and peace be upon him, said: “Command your children to pray at seven, beat them for praying at ten, and separate them in their beds.”
(4) The fourth condition: removing the impurity, which is the well-known ablution, and its necessitation is the impurity.
(1) The first condition: Islam, meaning: it must be from the time he enters the prayer until a Muslim comes out of it, so if he prays while he is an unbeliever, his prayer is invalid; For the Almighty said: {It is not for the polytheists to inhabit the mosques of God, bearing witness against themselves in disbelief. Such are their deeds, and in the Fire they will abide} [Repentance :17], and His Almighty said: {And if they had associated partners, what they used to do would have been lost to them} [Al-An’am: 153], and His saying Glory be to Him: {And whoever disbelieves in faith, indeed his work has become worthless} [Al-Ma’idah: 5], and His Glory be to Him: {And We will return to the work they did and make it scattered in vain} [Al-Furqan: 23], so every human being is judged by his disbelief. His prayer is invalid. If he prayed before entering Islam, it is not valid until he converts to Islam. (2) The second condition: the mind, that he has a mind that distinguishes between what harms him and what benefits him, and between good and evil. However, if he is crazy or an idiot who cannot distinguish, then there is no prayer for him; According to his saying, may God’s prayers and peace be upon him: “The Pen has been lifted from three people: the sleeping person until he wakes up, the insane person until he wakes up, and the young person until he reaches puberty.” ..... (3) The third condition: discrimination, and its opposite is young age, which alone is seven years, then he is ordered to pray; Because of his saying, may God’s prayers and peace be upon him: “Command your children to pray at seven, and beat them for it at ten,” and his saying, may God’s prayers and peace be upon him, in the hadith: “The child until he reaches puberty,” meaning: he is not obligated, and he is not obligated to the point that he sins only after he reaches puberty, but he is commanded to do it before this. Sunnah is a preparation and training for prayer. Even when he reaches puberty, he is accustomed to it and has practiced it. (4) The fourth condition: removing the impurity, that is: since it is purified from the major and minor impurities, it must be pure; Because of his saying, may God’s prayers and peace be upon him: “No prayer is accepted without purification,” and because of his saying, may God’s prayers and peace be upon him: “The prayer of any of you will not be accepted if he breaks his fast until he performs ablution,” so it is necessary to remove the impurity with water when it is present, or to perform tayammum when there is no water or inability to do so.