Metals conduct electricity and heat better than nonmetals because their electrons can move more easily and thereby transfer energy. Also, metals have a more solid crystalline structure with less space between the electrons. Heat and electricity are both forms of energy that travel via direct conduction.
Metals are located on the left-hand side of the periodic table of elements. Their valence shells, i.e. the outermost layers of electrons, have few electrons and are therefore prone to losing them as an electrical current is introduced, in order to keep a full valence shell. For example, if a current is introduced to one end of a bar of iron, the electrons strike the first edges of the bar. Electromagnetic repulsion causes a free electron or two to split from the atom and travel to the next atom in sequence. This reaction happens almost instantly.
Because electrons can move easily from atom to atom, they can carry thermal energy with them. No matter how good a conductor the metal in question is, a small amount of energy is lost to friction as electrons make contact with one another. This is why electrical wires that carry a lot of current have to be thicker, so electrons have space to move without creating too much heat.