Nonmetals can form different types of bonds depending on their partner atoms. Ionic bonds form when a nonmetal and a metal exchange electrons, while covalent bonds form when electrons are shared between two nonmetals.
An ionic bond is a type of chemical bond formed through an electrostatic attraction between two oppositely charged ions. Ionic bonds are formed between a cation, which is usually a metal, and an anion, which is usually a nonmetal. Pure ionic bonding cannot exist: all ionic compounds have some degree of covalent bonding. Thus, an ionic bond is considered a bond where the ionic character is greater than the covalent character. The larger the difference in electronegativity between the two atoms involved in the bond, the more ionic (polar) the bond is. Bonds with partially ionic and partially covalent character are called polar covalent bonds.
Covalent bonding occurs when pairs of electrons are shared by atoms. Atoms will bond covalently with other atoms in order to gain more stability, which is gained by forming a valence level full of electrons. By sharing their outermost (valence) electrons, atoms can fill up their outer electron level and gain stability. Nonmetals will readily form covalent bonds with other nonmetals in order to obtain stability. They can form anywhere between one to three covalent bonds with other nonmetals depending on how many valence electrons they possess.
Although it is said that atoms share electrons when they form covalent bonds, they do not usually share the electrons equally. Only when two atoms of the same element form a covalent bond are the shared electrons actually shared equally between the atoms. When atoms of different elements share electrons through covalent bonding, the electron will be drawn more toward the atom with the higher electronegativity, resulting in a polar covalent bond.
When compared to ionic compounds, covalent compounds usually have a lower melting and boiling point and have less of a tendency to dissolve in water. Covalent compounds can be in a gas, liquid, or solid state and do not conduct electricity or heat well.