ENOfficial
It was narrated from 'Ali bin Abu Talib that: the Messenger of Allah (ﷺ) said: "The Pen is lifted from the minor, the insane person and the sleeper."
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا رَوْحُ بْنُ عُبَادَةَ، حَدَّثَنَا ابْنُ جُرَيْجٍ، أَنْبَأَنَا الْقَاسِمُ بْنُ يَزِيدَ، عَنْ عَلِيِّ بْنِ أَبِي طَالِبٍ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ " يُرْفَعُ الْقَلَمُ عَنِ الصَّغِيرِ وَعَنِ الْمَجْنُونِ وَعَنِ النَّائِمِ " .
sunnah.com