The correct statement is:
They have valence electrons in the same energy level.
Nitrogen and oxygen are in the same period (the second period) of the periodic table, which means they have valence electrons in the same principal energy level (n=2). However, they do not have the same number of valence electrons; nitrogen has 5, and oxygen has 6. They also do not have the same number of electrons overall, as nitrogen has 7 electrons and oxygen has 8 electrons.