Compounds consist of molecules. Molecules consist of more than one type ofatoms bonded to each other. These bonds are created in a variety of ways but they all form when they share or give/take electrons. Electrons that take part in the bonds are in the outer part of the atom.
Hope this helps