Atoms of all elements, other than inert gases, combine to form molecules because they have incomplete valence shell and tend to attain a stable electronic configuration similar to noble gases. Atoms can combine either by transfer of valence electrons from one atom to another or by sharing of valence electrons in order to achieve the stable outer shell of eight electrons.