A molecule is formed when two or more atoms join together chemically. A compound is a molecule that contains at least two different elements. All compounds are molecules but not all molecules are compounds.
Molecular hydrogen (H2), molecular oxygen (O2) and molecular nitrogen (N2) are not compounds because each is composed of a single element.Water (H2O), carbon dioxide (CO2) and methane (CH4) are compounds because each is made from more than one element. The smallest bit of each of these substances would be referred to as a molecule. For example, a single molecule of molecular hydrogen is made from two atoms of hydrogen while a single molecule of water is made from two atoms of hydrogen and one atom of oxygen.