Re: How to unlock?
AT&T started cracking down hard on unlocking iphones around Oct 2013. Basically, your phone must be paid for in full and not in any sort of contract or financing plan. Also you must have been a customer for at least 90 days and your account must be in good standing.
Just about every 3rd party unlocking site will also yield an unsuccessful unlock since they all pretty much go through AT&T to get the code, which means, again, if your phone was purchased on contract or AT&T Next financing plan, and/or your account is not in good standing, etc., the 3rd party will not be able to get the code from AT&T.
Back in Oct 2013, damn near every single 3rd party unlocking site for iphones pulled that particular service since AT&T basically cut them all off from getting codes. The ones who claimed they could still offer the service were charging upwards for $150+, when in Sept 2013, iphone unlock codes could be had for as low as $2.00.
As DroidArmy stated, you pretty much need to go through AT&T to get the code, but unless you meet their requirements, they will keep rejecting your requests. However, there is a fraction of a chance you might get lucky in where they slip up and grant your request.....you never know, and I have heard of this happening recently.