Unlocking an iPhone 4s for T-mobile?

So my friend just sold me his iPhone 4s that he had for At&t and I'm trying to figure out how to get it to work for T-mobile. I have a micro-sim card for T-mobile for the phone, but the service doesn't work. How can I unlock the phone for my carrier? Its running 5.1.1 and I have tried jailbreaking it and running it through SAM and it didn't work.

I think that you can't
Cause t, Obie doesn't have features for iPhone
Just sprint, verizon or AT&T
I hope I helped you.
Hey please
Download poshmark at AppStore
And when you are registering please
Put this code
HPUNW
PUT IT where it says invite code please it's to earn points.