
Lewis Structure for H2:
1) two total valence electrons, both H's share to attain their maximum number of bonds (1) and total electron count (2).
Lewis Structure for F2:
1) 14 total valence electrons, F's make one bond so as to reach their maximum number of bonds (1), and total electron count (8) as shown in I. Alternative structures (II and III) are INVALID. Reason? They contain 10 electrons on F which is impossible. Verify for yourself that the formal charges (QF) shown are correct.
Lewis Structure for O2:
1) 12 valence electrons, the oxygen atoms can make an additional bond
before reaching their maximum number of electrons (8). Structure
II is the best.
Structure (I) is also valid, but not as good, since it conatins
fewer O-O bonds. Structure III is invalid because it contains
a 10 electron oxygen (impossible).
Lewis Structure for N2:
1) 10 valence electrons, the nitrogen atoms make three bonds in the
best structure, III, wherein both attain an electron count of 8.
Both I and II are also valid, but are higher energy states
than III.
2) A skeleton structure is shown in I with only single bonds between C and O. This structure is not as good as multiply bonded structures II or III by virtue of the fewer number of bonds. Note the formal charges on II and III do not make them worse because bonding is the key... The rule: no more than 8 electrons on any 2nd period atom is not disobeyed for any of the three structures. The best structure is shown in IV.

3) The structure in IV below is the overall best structure. It contains the same number of bonds as III, but has no formal charges on any atom. The formal (+) charge on oxygen in III is somewhat troublesome, since we know oxygen is far more electronegative than carbon. All of the atoms attain their maximum total electron count of 8.
