C2 has 12 electrons.
(σ1s)2,(σ∗1s)2,(σ2s)2,(σ∗2s)2,(π)4
So, Bond Order=12(a−b)
Here, a is the number of electrons in bonding molecular orbitals and b is the number of electrons in antibondng molecular orbitals.
Bond Order=12(8−4)=2
Number of pi bonds in C2 is 2.
Therefore, sum is 2+2=4