A molecule now, is a formed when two or more atoms combine. If the same kind of atoms combine, the substance they form will be called an element ( remember, same type of atoms). Now comes the catch. If two different types of atoms combine to form a molecule, the pure substance formed by these molecules will be called a compound. This bit is very important.
I repeat, a compound is a pure substance formed by the molecules composed of different types of atoms ( say hydrogen and oxygen atoms combine to form a water molecule and many millions of water molecules will form the compound