FORM of N2 gas makes up around 80% of air, and Oxygen in the form of O2 makes up around 20%. There is a FRACTION of a percent of CO2 as well as traces of other gasses. The largest component of air, by volume, is nitrogen. THUS, we NEED to consider both N2 and O2.Hence, magnesium REACTS with both nitrogen and oxygen to give the following compounds:\(Mg + {O_2}\mathop {\xrightarrow[]{\Delta}}\limits^{\;\;\;\;\;\;\;\;\;\;\;\;\;} MgO\)\(Mg + {N_2}\mathop {\xrightarrow[]{\Delta}}\limits^{\;\;\;\;\;\;\;\;\;\;\;\;\;} Mg_3N_2\)Thus, Mg burns in air and produces a mixture of nitride and oxide.Therefore, both MgO and Mg3N2 are formed.