Praise be to Allaah.
If she has not yet reached puberty, then her prayer is valid,
because the Prophet (peace and blessings of Allaah be upon him) said:
“Allaah does not accept the prayer of a woman who menstruates unless she
wears a head cover.” This indicates that if a female who does not
menstruate, i.e., she has not reached puberty, prays without a head cover,
there is nothing wrong with it. But it is better for her to pray with a head
cover if she is seven years old or more. Those below the age of seven,
whether male or female, are not required to pray, because the Prophet
(peace and blessings of Allaah be upon him) said: “Teach your children to
pray when they are seven, and smack them if they do not pray when they are
ten, and separate them in their beds.” End quote.
Majmoo’ Fataawa al-Shaykh Ibn Baaz (29/200).