For T-shape geometry the molecule must have 3 bonded pair and 2 lone pair of electrons T-shape of MX3 is due to sp3d hybridization, where the molecule has 3 bond pairs and 2 lone pairs (non-bonded electrons). So, number of non-bonding electron pairs is 2.