In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear questioner, we commend your keenness on getting yourself well-acquainted with Islam and its teachings, and we implore Allah Almighty to help us serve His cause and render our work for His Sake.
A person is not held accountable for what he does while he or she has not yet reached the age of puberty. A person is not punished for anything he/she does during this period.
The Prophet (peace and blessings be upon him) has stated this, “The pen has been raised for three persons (meaning they are not held accountable for what they do): one who is sleeping until he gets up, a child until he reaches the age of puberty, and an insane person until he becomes sane.” (Ahmad, Abu Dawud, At-Tirmidhi, An-Nasa’i, Ibn Majah, and Al-Hakim)
It is out of Allah’s absolute Justice that children are not held accountable for the deeds they do before the age of puberty. Not only this, but out of Allah’s infinite mercy and favor they will be rewarded for any good deed they do as well as those who guide and encourage them to do so.
Ibn Rushd said, “The bad deeds of young children are not recorded but their good deeds will be recorded, according to the sound opinion.”
The author of Mawahib al-Jalil said: “The scholars do not differ concerning the fact that children will be rewarded for whatever acts of obedience (to Allah) they do, and will be let off for any bad deeds that they do, and any bad deeds they do deliberately will be counted as mistakes.”
According to Al-Ikmal, many of the scholars said, “Children will be rewarded for their acts of obedience (to Allah), and their good deeds will be recorded, but not their bad deeds.”
Allah Almighty knows best.