How to unlock iphone 5 from AT&T at home?

I was with att for a while but I'm sick of all of their fees and all this ridiculous nonsense they keep charging me extra for. I went to t mobile for their I carrier program, and I signed up and had my number ported over. What I was trying to do was sign over and continue using my same phone with my same number. So anyway, I had it all done and the guy told me to just wait and I'd get a text saying welcome to t mobile blah blah blah. I couldn't even activate my phone BECASE it's still locked I att! I called them and they refused to unlock it until I pay them $300 for the past two months. I have no intention of paying that bs. So I heard there are company's that can unlock your phone for a price, but if I can I really want to just do it myself at home. And no I'm not cheap, I'm just really broke. What ways can I unlock my phone from my carrier?!

You can't