If you have a metal atom and a non-metal atom, they bond by ionic bonding. If you have two non-metal atoms, they bond by covalent bonding. What happens if both atoms are metals?
The third type of bonding you need to know about is called metallic bonding. You can guess from the name that it's the type of bonding that happens between two metallic atoms. All the atoms in a piece of metal need to lose electrons, none will take any more electrons. The unwanted electrons move between the atoms; scientists talk about a "sea of electrons" flowing between the metal ions.
The atoms in a metal are held together by electrostatic attraction between the positive metal ions and the sea of negative electrons. The metal ions are pulled tightly together in a regular repeating close-packed structure. The atomic structure of gold looks like this.
We can explain a lot of the properties of metals by thinking about this model of metallic bonding. Because the electrons in the sea aren't attached to atoms, they can move through the metal easily. This makes metals good conductors of electricity and heat. The electrostatic bonds between the metal ions and the electrons are hard to break, so metals are strong. However, it's easier to move layers of atoms over each other. This means that metals can easily be bent into new shapes; scientists call this being malleable. The strength of the metallic bonds also explains why metals have high melting and boiling temperatures; we need to add a lot of energy to the metal to break the bonds between the metal ions.
There are three types of bonding you need to know. To work out which one you have, decide whether the atoms are metals or non-metals. In the end, it all depends on what the electron shells are doing, which is why they are so important.