Earth's atmosphere has gone through multiple distinct phases throughout its life, from a hydrogen-rich early period to the modern oxidizing chemistry. The first atmosphere Earth had was chemically very similar to the composition of the primordial dust and gas cloud from which the solar system formed. This chemistry can be seen in some asteroids, and it is a combination of hydrogen, helium and complex organic molecules.
That first atmosphere didn't last long. It was composed almost exclusively of light gases and exposed to the solar wind. Early in its history, Earth lacked a differentiated core. For this reason, the planet lacked a strong magnetic field to deflect charged particles ejected by the Sun. This, combined with the tendency for light gases to waft away into space, depleted Earth's first atmosphere.
The second atmosphere was composed mainly of compounds that were outgassed by Earth's many active volcanoes. This atmosphere was rich in water vapor, carbon dioxide, sulfur dioxide, sulfur and chlorine. Hydrogen was also present in this environment, as was molecular nitrogen. By this time, Earth's core had differentiated, and a strong magnetic field permitted the retention of a large atmosphere.
Eventually, life evolved to convert sunlight into chemical energy. Molecular oxygen, which is not found in volcanic gases, is a byproduct of photosynthesis and was released in large amounts between 2 and 2.8 billion years ago, causing characteristic banded-iron formations in rocks of that age.