The formation of a double bond in an oxygen molecule is explained below. Arrange the given points in a sequential order.
(a) 2py orbitals of each oxygen atom overlap laterally/sidewise to form a pi bond.
(b) Thus, a double bond between two oxygen atoms in which one pz - pz sigma bond and py - py π bond is formed.
(c) All the three 2p orbitals are perpendicular to each other. Hence 2pz orbitals of each oxygen atom overlap end to end to form a sigma bond.
(d) The electronic configuration of oxygen is O: 1s22s22p1x2p2y2p1z