Recently I came across nonbonding orbitals. I know something about bonding and antibonding orbitals and their formation, but I have no idea about nonbonding orbitals. Could someone explain their formation and the difference when compared with the other two?
In basic MO theory, when two atomic orbitals mix, they form an in-phase (bonding) and out-of-phase (antibonding) molecular orbital. The primary criteria for this mixing are having the same symmetry and being near in energy. If you mix your atomic orbitals together, but find that some of the atomic orbitals have no symmetry match with a similar enough energy, then these unmatched atomic orbitals do not mix and become non-bonding MOs.
Consider hydrogen fluoride. The 1s orbital on hydrogen has the same symmetry as the $p_z$ orbital on fluorine. These mix into a bonding and antibonding orbital. Hydrogen however does not offer any other occupied atomic orbitals with matching symmetry for the $p_x$ and $p_y$ atomic orbitals on fluorine. Therefore, these orbitals remain as non-bonding. Furthermore, the 2s fluorine atomic orbitals are much lower in energy than hydrogen's 1s orbital, so this does not mix appreciably either, and can therefore also be treated as non-bonding.
For elementary concepts, I think you just need to know about how these contribute to bond order. The occupancy of non-bonding orbitals does not have any effect on the bond order and are typically considered lone-pairs.