Hund’s Principle: According to this rule, electron pairing will not take place in orbital of same energy (same subshell) until each orbital is singly tilled.
According to Hund’s principle, electronic principle O2 and P are shown below:
Oxygen (8): 1s2 2s2 2px2 3py1 4pz1
Phosphorous (15): 1s2 2s2 2px2 2py2 2pz2 3s2 3px1 3py1 3pz1