Primarily TAI of UE (serving area) is used to select SGW. Further DNS resolves FQDN to an address. Topology is another controlling parameter for selecting SGW. It all depends on how network is deployed and accordingly selection parameters are triggered. For basic, TAI is used for selecting SGW