"But I am wondering if the phone is locked out and they don't have access to it, does it still connect to internet to be tracked?"
Yes, but it need not be solely through Wifi. The iOS device needs only to be online. How does Apple define online for an iOS device?:
"An iOS device is online if it’s turned on (with or without a passcode lock) and connected to a data network, such as EDGE, 3G, 4G, or Wi-Fi. "
So, if your device is online, here's how to track it:
Locate your iOS device:
Sign in to icloud.com/#find with your Apple ID (the one you use with iCloud).
If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click Find My iPhone.
Click All Devices, then select the device you want to locate.
In the list, the dot next to the device indicates its status:
A green dot means it’s online.
A gray dot means it’s offline.
If the device is online, its approximate location is shown on the map. The green circle around the device indicates its location (the smaller the circle, the better the accuracy).
Note that Find my iPhone is a prerequisite, though it's clearly enabled if you already locked the device.