Sunan Abi Dawud, Book 40, Hadith 48 (Abu Dawud 4400)

Narrated Aisha, Ummul Mu'minin:

The Messenger of Allah (ﷺ) said: There are three (persons) whose actions are not recorded: a sleeper till he awakes, an idiot till he is restored to reason, and a boy till he reaches puberty.