Nitrogen is present in nature in nearly 78% and oxygen in 21% amount and not vise versa.
This Ratio is due to high reactivity of oxygen gas .Oxygen is highly reactive thus it reacts with most of the elements and compounds present on earth and thus form oxygen compounds. This is the reason why oxygen is not present in high amounts in elemental form rather it is mainly present as compounds containing oxygen.
On the other hand nitrogen is inert in nature i.e. it has very low reactivity thus does not react much with other materials. Also nitrogen is stable in the presence of sunlight. That is why nitrogen is present in nature in such a high amount .