The Prophet ﷺ said, "The pen is lifted from three: from the sleeper until he wakes, from the mentally impaired," or he said, "the insane, until he regains his reason, and from the young child until he reaches maturity."
حدثنا بهز وحدثنا عفان قالا حدثنا همام عن قتادة عن الحسن البصري
أن النبي ﷺ قال رفع القلم عن ثلاثة عن النائم حتى يستيقظ وعن المعتوه أو قال المجنون حتى يعقل وعن الصغير حتى يشب