For AB5 molecules, there are three possible geometries i.e. planar pentagonal, square pyramidal and trigonal bipyramidal.
Out of these three geometries, it is only trigonal pyramidal shape in which bond pair-bond pair repulsions are minimum and hence this geometry is the most probable geometry of AB5