In modern periodic table nitrogen is placed just before oxygen in the 2nd period because:
Oxygen has one more proton in its nucleus than nitrogen.
Elements are classified based on on their increasing atomic number in the modern periodic table. So all the other reasons (even correct) will not be considered while deciding the placement of elements in the periodic table.
Atomic number is the number of protons present in the nucleus of an atom. Nitrogen has 7 protons and oxygen has 8. Hence nitrogen is placed just before oxygen.