The guidance of the Prophet ﷺ
The Prophet ﷺ said: "Command the boy to pray when he reaches seven years" (Sunan Abi Dawud 494). In another narration he said: "Teach the boy the prayer when he is seven" (Jami at-Tirmidhi 407), which at-Tirmidhi graded hasan sahih. Scholars explain that the ruling applies to girls as well as boys.
Prayer is not yet obligatory on a child. It becomes obligatory at puberty, and the years before that are a period of training and preparation. The word "command" is understood as teaching, encouraging and following up, so that the habit is firm by the time the obligation begins.



