How was the atmosphere of the Earth formed?
degassing from the cooling rocks and biological activity
In the very early phase of the Earth life the planet was a mass of melted rock that progressively cooled down.
During this process gases escaped from the rocks accumulating to form a primordial atmosphere likely similar to the one of Venus.
Further gases, including water vapor, were emitted, and are still emitted, during volcanic activity that, in the early stages of the planet, was much more intense than now.
The atmosphere was depleted of oxygen and this gas started to accumulate only when photosynthetic life forms evolved on the planet. Other geological events, such as changes in the redox state of the gases emitted from the mantle of the planet, also contributed in the rising of oxygen concentration.
This event is called "The Great Oxidation Event" and happen around 2.4 - 2.5 billion years ago leading to the extinction of many of the lifeforms that lived in an anoxic world and opened the path for the evolution of the life of oxygen-breathing organisms.
Heinrich Holland of Princeton in the 1960s concluded that the earth's primitive atmosphere came from gases released by the Earth's volcanos page 447-477 Model for the Evolution of the Earth's Atmosphere.
The water released from the volcanos were undergo the process of photodissociation which splits water molecules into Hydrogen and Oxygen. Much of the Hydrogen being lighter ( mass 2 for Hydrogen mass 32 for Oxygen. ) would dissipate into space leaving an Oxygen rich atmosphere. Philip H. Abelson " Chemical Events on the Primitive Earth National Academy of Sciences USA 55 1966 pages 1365- 1372)
There was never a time when the earth's early atmosphere did not have a significant percentage of Oxygen, due to the water being released by volcanic activity.