Electrons want a full valence shell or outer shell. When they get a full valence shell they are so called "happy."
Ionic bonds: these types of bonds happen between a metal and a non-metal. When an ionic bond takes place the two atoms give/take electrons. For example Magnesium has two electrons in it's valence shell and Oxygen has six in it's valence shell, when they bond together Magnesium gives it's two electrons to Oxygen who had six and now has eight. Now they are both "happy" or have a full valence shell. This is what an ionic bond looks like this:
Covalent bonds: these bonds happen between two non-metals. When a covalent bond takes place the two non-metals share electrons. For example Fluorine has seven electrons in it's valence shell and Chlorine has seven electrons in it's valence shell also. when they share electrons they each have one that is unpaired so they hook up and are then paired even though they are from different atoms.
Metallic bonds: these are when noble gases join together but they are already "happy." So more than two join together and they don't really do anything, but since all of the atoms have the same number of electrons in the valence shell the electrons just float around anywhere they want to. This is what they look like:



