Ionic bonding occurs between a metal and a nonmetal. Covalent bonding, on the other hand, occurs between two nonmetals. The properties of these two types of compounds are different. Ionic compounds are usually solids at room temperature, while covalently bonded compounds can be solids, liquids, or gases.
Ionic compounds are (usually) formed when a metal reacts with a nonmetal (or a polyatomic ion). Covalent compounds are formed when two nonmetals react with each other. Since hydrogen is a nonmetal, binary compounds containing hydrogen are also usually covalent compounds.