A molecule is formed when two or more atoms join together. And a compound is a molecule that contains at least two different elements. Therefore all compounds are molecules but not all molecules are compounds. See here for more information:
education.jlab.org
education.jlab.org