Conditions for Ionic and Covalent Bonding