Scholars unanimously agree that the child who has not yet reached puberty is not punished by Allah for either the abandonment of acts of worship or the commitment of bad deeds. Still, it is desirable that the child’s guardian order him or her to perform acts of worship to get used to them, and Allah, out of His grace and favor, rewards the child for such acts of worship.
In his book entitled Al-Mughni, Ibn Qudamah states:
Islam records only the deeds in favor of the child, not those against him, and this is in the best interest of the child in both this world and the Hereafter. To illustrate, the child’s valid performance of Prayer is recorded as a valid act of worship and rewarded, though it is not obligatory for him. The same applies to all other acts of worship.
On the other hand, As-Subki said:
Children are recommended to observe religious practices and rituals. They, for instance, are recommended to offer Prayer and will be rewarded for it.
Moreover, An-Nawawi states in his book Al-Majmu`:
The followers of our school of jurisprudence and others state, “A child is rewarded for the good deeds he performs, such as ablution, Prayer, fasting, zakah, i`tikaf (seclusion in a mosque), Hajj, recitation of the Qur’an, and suchlike acts of obedience to Allah. On the other hand, a child is not liable for his bad deeds as scholars unanimously agree.”
The legal proofs of this ruling are the well-known authentic hadiths such as the one in which a woman showed her young son to the Prophet (peace and blessings be upon him) during Hajj and asked, “O Allah’s Messenger! Is this (boy) rewarded for Hajj?” The Prophet replied, “Yes, and you will be rewarded as well.” Moreover, As-Sa’ib ibn Yazid narrated: “(While in the company of my parents) I was made to perform Hajj with Allah’s Messenger in the year of the Farewell Hajj and I was a seven-year-old boy then” (Al-Bukhari).
Also, Jabir narrated: “We performed Hajj with Allah’s Messenger (peace and blessings be upon him) while accompanied by women and children, so we said the Talbiyah (a formula recited during Hajj) and threw the stones (one of the rituals of Hajj) on behalf of the children” (Ibn Majah).
There are other hadiths in this connection, such as the hadith stating that Ibn `Abbas, who was a child then, performed Prayer with the Prophet, and the one indicating that children were made to fast the Day of `Ashura’ (10th of Muharram) during the lifetime of the Prophet (peace and blessings be upon him), and both hadiths are stated in the two authentic books of Al-Bukhari and Muslim. In addition, the Prophet said in an authentic hadith: “Instruct your children to perform Prayer when they reach the age of seven.” (Sunan Abu Daud). Furthermore, there is a hadith in Al-Bukhari’s Sahih stating that `Amr ibn Salamah led the people in congregational Prayer while he was just seven year old. There are other similar hadiths in this regard.
The Kuwaiti Encyclopedia of Jurisprudence states:
The premise is that incompetent persons such as children and lunatics are not liable for legal obligations. However, a discerning child is rewarded if he performs an act of worship due to his effort despite his limited ability. Thus, a child’s Prayer, fasting, zakah, i`tikaf, Hajj and suchlike acts of worship are deemed valid, and the child is divinely rewarded for them.
The legal proof of the validity of a child’s performance of an act of worship is that the Prophet (peace and blessings be upon him) said: “Instruct your children to perform Prayer when they reach the age of seven and discipline them for (not performing) it when they reach the age of ten.” (Sunan Abu Dawud). Another proof is the following hadith narrated by Ibn `Abbas, who was a child then: “Once I stayed overnight in the house of my aunt Maimunah (a wife of the Prophet) and the Prophet offered the `Isha’ Prayer (in the mosque), returned home and after having prayed four rak`ahs, he slept. Then he got up for the Prayer and I stood up by his left side (to be led by him in Prayer) but he made me stand on his right side.” (Bukhari and Muslim). Moreover, the Prophet’s Companions used to make their children fast the Day of `Ashura’. In addition, Ar-Rubai` bint Mu`awwadh narrated: “The Prophet sent a messenger to the village of the Ansar on the morning of the Day of `Ashura’ to announce: ‘Whoever has eaten something should not eat but complete the fast, and whoever is observing the fast should complete it.’ Since then, we used to fast on that day regularly and also make our children fast it. We used to make toys of wool for the children and if anyone of them cried for food, he was given those toys till it was the time of the breaking of the fast.” (Bukhari and Muslim)