2s and 2p atomic orbitals combine, forming σ (sigma) and π (pi) molecular orbitals. σ orbitals result from head-on overlap, while π orbitals arise from sideways overlap. This molecular orbital theory explains the bonding in molecules
2s orbital will form, two molecular orbitals σ2s and σ∗2s.
2p orbital will form six molecular orbitals σ2pz and σ∗2pz. π2px,π2py and π∗2px,π∗2py
Hence the total number of molecular orbitals formed from 2s and 2p atomic orbitals of a diatomic molecule formed is 8.