With trigonal bipyramidal structures, lone pairs are preferred to be in the equatorial position rather than axial (above/below), since there is less repulsion if you put the lone pair in the equatorial position. Therefore, you would have one atom and two lone pairs bound in the equatorial plane, while there would be 2 atoms bound in the axial position. Therefore, the structure resembles a T, hence its name. Hope this helps!

It is T-shaped as you are having the electron pairs occupy the equatorial spots in order to reduce the effect they will have on the bonds. In doing this you are left with one equatorial and the top and bottom leading to T-shaped.

When atoms are replaced by lone pairs to make a T-shape, the atoms are from the equatorial positions because these atoms had a bond angle of 120 degrees. The axial atoms are not replaced because those atoms are only 90 degrees from the equatorial atoms. This maximizes the distance between the lone pairs and the bonded atoms.

The T-shape allows the two lone pairs of electrons to be farthest apart if they occupy two of the three equatorial positions. If they were to occupy axial positions, there would be great repulsion by the electrons.