عن علي رضي الله عنه عن النبي صلى الله عليه وسلم قال: «رُفِعَ الْقَلَمُ عن ثلاثة: عن النائم حتى يَسْتَيْقِظَ، وعن الصبي حتى يَحْتَلِمَ، وعن المجنون حتى يَعْقِلَ».
The Prophet (may Allah's peace and blessings be upon him) informed that accountability is binding on all the children of Adam except for these three: A child till he grows up and reaches puberty. An insane and crazy person till his mind is restored. A sleeping person till he wakes up. Accountability has been lifted from them, and their sinful actions are not recorded against them.
However, goodness is recorded for a young boy, but not for the insane or sleeping person, because they are in the category of those who are not capable of valid worship due to the loss of consciousness.
Download for free and never miss a prayer again