A molecule is composed of two or more atoms that are covalently bonded, which means they share electrons. A molecular compound is composed of atoms of two or more elements that are covalently bonded.
The image below represents four examples of atoms bonding by sharing electrons (covalent bonding), which produces molecules.
The first two,
The second two,