Sabrah bin Ma'bad Al-Juhani (May Allah be pleased with him) reported:
Messenger of Allah (ﷺ) said, "Teach a boy Salat (the prayer) when he attains the age of seven years, and punish him (if he does not offer it) at ten".[Abu Dawud and Tirmidhi, who categorized it as Hadith Hasan].The narration in Abu Dawud is: Messenger of Allah (ﷺ) said, "Order a boy to perform Salat (the prayer) when he is seven years old".