What are COMPOUNDS?

If there are only 90 types of atoms found on Earth, how do we have over 100 million different substances? Because just as Legos link together to make structures and letters link together to make words, atoms link together to form different substances called COMPOUNDS!