Complexes are formed through ligand binding (donation of a pair of electrons to the central metal atom), and the shape of the complexes is usually determined by steric factors - or how the ligands can arrange themselves to be as far away from each other as possible. For this reason:
-2 coordinate complexes are linear e.g. [Ag(NH3)2]+
-4 coordinate complexes TEND TO BE tetrahedral, e.g. [CuCl4]2- however some group 8 metals, such as Platinum, prefer to form square planar complexes due to favourable energetics - e.g. cisplatin - Pt(NH3)2Cl2
-6 coordinate complexes are octahedral e.g. [Fe(OH2)6]2+
3 and 5 coordinate complexes are very rare since usuaully there is enough room to form 4 and 6 coordinated complexes.
Complexes with more than 6 ligands are also very rare because there isn't usually enough space to fit 7 ligands around a complex without very unfavourable steric repulsion between ligands.