Bond order is defined as one half of the difference between the number of electrons present in the bonding and anti-bonding orbitals of a molecule.
If $N_{b}$ is the number of electrons in bonding orbitals and $N_{a}$ is the number of electrons in anti-bonding orbitals,then:
Bond order $= \frac{1}{2} (N_{b} - N_{a})$
$1$. For $N_{2}$ ($14$ electrons):
Configuration: $[\sigma(1s)]^2 [\sigma^{*}(1s)]^2 [\sigma(2s)]^2 [\sigma^{*}(2s)]^2 [\pi(2p_{x})]^2 [\pi(2p_{y})]^2 [\sigma(2p_{z})]^2$
$N_{b} = 10, N_{a} = 4$
Bond order $= \frac{1}{2} (10 - 4) = 3$
$2$. For $O_{2}$ ($16$ electrons):
Configuration: $[\sigma(1s)]^2 [\sigma^{*}(1s)]^2 [\sigma(2s)]^2 [\sigma^{*}(2s)]^2 [\sigma(2p_{z})]^2 [\pi(2p_{x})]^2 [\pi(2p_{y})]^2 [\pi^{*}(2p_{x})]^1 [\pi^{*}(2p_{y})]^1$
$N_{b} = 10, N_{a} = 6$
Bond order $= \frac{1}{2} (10 - 6) = 2$
$3$. For $O_{2}^{+}$ ($15$ electrons):
Configuration: $KK [\sigma(2s)]^2 [\sigma^{*}(2s)]^2 [\sigma(2p_{z})]^2 [\pi(2p_{x})]^2 [\pi(2p_{y})]^2 [\pi^{*}(2p_{x})]^1$
$N_{b} = 8, N_{a} = 3$ (excluding $KK$ shell)
Bond order $= \frac{1}{2} (8 - 3) = 2.5$
$4$. For $O_{2}^{-}$ ($17$ electrons):
Configuration: $KK [\sigma(2s)]^2 [\sigma^{*}(2s)]^2 [\sigma(2p_{z})]^2 [\pi(2p_{x})]^2 [\pi(2p_{y})]^2 [\pi^{*}(2p_{x})]^2 [\pi^{*}(2p_{y})]^1$
$N_{b} = 8, N_{a} = 5$ (excluding $KK$ shell)
Bond order $= \frac{1}{2} (8 - 5) = 1.5$