Praise be to Allah.
The Hajj of a minor child is valid, as has already been stated in Question no. 13636. But it does not count as the obligatory Hajj. Rather when the person reached adolescence he has to do Hajj again when he is able to.
This is the view of the majority of the scholars from all four schools of law; indeed it was narrated that there is consensus on this point.
This is because of the hadeeth of Ibn ‘Abbaas (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Any child who does Hajj then reaches adolescence has to do another Hajj.” Narrated by Ibn Abi Shaybah and classed as saheeh by Ibn Hajar in al-Talkhees, 2/220, and by al-Albaani in al-Irwa’, 4/159.
Ibn Qudaamah said in al-Mughni, 5/44: Ibn al-Mundhir said: The scholars are agreed – apart from those who held odd views and whose opinions are not significant – that if a child does Hajj when he is small, and if a slave does Hajj when he is still enslaved, then the child reaches adolescence and the slave gains his freedom, they have to do the obligatory Hajj, if they have the means to do so.
And it says in Fataawa al-Lajnah al-Daa’imah:
Hajj and ‘Umrah done by one who has not yet reached adolescence is considered as voluntary, and does not count as the obligatory Hajj and ‘Umrah of Islam.
Fataawa al-Lajnah, (11/24).