Do not buy full price phones from bestbuy. They are $50 more than what apple charges and to be honest most bestbuys wont sell phones out of contract.
If you want to get unlocked phone, just go to the apple store online and pick the unlocked version.
But a full price AT&T phone bought out of contract will be unlocked when you activate it thru iTunes.
Keep in mind that any AT&T iPhone 5 made before the Spring of 2013 (when Tmo launched their LTE network) will not support the AWS band Tmobile uses to get LTE service, so you'll see '4G' at best.