how do I restrict my android phone to just my home and work wifi?
Android won't connect to a wifi access point without you specifying that you want to and saving it. 

Under settings, wifi, long-press on the names of any access points you don't want to connect to and choose "Forget Network".