I heard the Messenger of Allah ﷺ say: ʿThe Pen has been lifted from three: from the child until he reaches puberty, from the sleeper until he wakes up and from the insane until he regains his sanity.” (Using translation from Aḥmad 940)
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ رُفِعَ الْقَلَمُ عَنْ ثَلَاثٍ عَنِ النَّائِمِ حَتَّى يَسْتَيْقِظَ وَعَنِ الْمَعْتُوهِ حَتَّى يَعْقِلَ وَعَنِ الصَّبِيِّ حَتَّى يَشِبَّ