If the child were left alone, he would worship Allah in his own way, but all children are affected by those things around them, seen or unseen.
The Prophet (PBUH) reported that Allah said, "I created my servants in the right religion but devils made them go astray". The Prophet (PBUH) also said, "Each child is born in a state of "Fitrah", then his parents make him a Jew, Christian or a Zoroastrian, the way an animal gives birth to a normal offspring. Have you noticed any that were born mutilated?" (Collected by Al-Bukhaaree and Muslim).
So, just as the child submits to the physical laws which Allah has put in nature, his soul also submits naturally to the fact that Allah is his Lord and Creator. But, his parents try to make him follow their own way and the child is not strong enough in the early stages of his life to resist or oppose the will of his parents. The religion which the child follows at this stage is one of custom and upbringing and Allah does not hold him to account or punish him for this religion. (By Abu Ameena Bilal Phillips )