Welcome to the stacks!
2 - To find out what OS, go to Options > About
should say for example v.220.127.116.11
This is the latest OS for Tmobile. You can search the threads for opinions about the different OS...
3- With Tmobile, depending on how long you've been with them, they will give you the unlock code for your phone. Just call and talk to a customer service person and ask for it.