The definition of an “ideal gas”
An ideal gas is any atom or molecule that exists with a full outer shell. Examples of ideal gases include: H2, O2, CO, CO2, N2O, N2, He.
Single oxygen and hydrogen atoms are not ideal gases
A single oxygen atom is not an ideal gas because it is missing two electrons from its outer shell.
However, an oxygen molecule is an ideal gas because it has a full outer shell of eight electrons. As it consists of two oxygen atoms, it is a diatomic molecule.
In a carbon monoxide (CO) molecule, an atom of oxygen and an atom of carbon share electrons in a triple bond. Both carbon’s need for an outer shell of 8 electrons and oxygen’s need for an outer shell of 8 electrons are satisfied.
Carbon monoxide is an ideal gas. You would not need to reproduce this, but you should know that carbon dioxide (CO2) is also an ideal gas.
I am an ideal gas. I have a full outer shell.
Helium is a noble gas with a full outer shell. Its atoms do not go exist as diatoms (in pairs).