The shape of magnesium chloride is linear because it is one dimensional, atoms are connected in a straight line and bond angle is 180. The chloride has 3 lone pairs. The magnesium has 2 electron clouds, all the electron clouds are bonded. The magnesium loses it's 1 electron and is given to chloride because of the electronegativity since chloride has a stronger pull force then magnesium.
Anhydrous Stannous chloride is angular covalent molecule because of the the repulsion between a lone pair of electrons on Sn and the two bonding pair of electrons.