Explain the octet rule for the formation of a molecule of sodium chloride from sodium and chlorine atoms.