Atmosphere of Earth
The most important thing to remember about the Earth and other planets is that they do not come from the Sun. They or their materials were picked up by the Sun's gravitation as it moved through space. The Sun is just composed of hydrogen, with a little bit of helium. Nothing else. The material which makes up planets and their satellites is almost entirely heavier elements whose origin was in earlier supernovae explosions. The planets do give off small quantities of hydrogen and helium: this comes from the decay of larger radioactive molecules whose origin is also ancient supernovae.