WARNING: Do this at your own risk! If your phone get bricked, you did something wrong but I have a link below to unbrick you phone.
1. Make sure that your phone is MK2 build and that the phone prompts for the SIM network unlock code when another carrier SIM is placed.
2. Buy a cheap IMEI unlock code somewhere, they should provide you the freeze code as well. I know! I also hope we can do this for free.
3. We will be using a method combination using method 2 from this link http://forum.xda-developers.com/show....php?t=2595457 and my troubleshooting procedures.
After buying the code. The cheapest one about $3.00 to $5.00. Google it. Follow the steps they provided. They will just tell you to insert other carrier SIM and when the SIM network unlock prompt pops out, type the unlock code and hit "unlock". If it doesn't work follow this steps:
Troubleshooting number 1:
1. Power on your phone with a different network sim card. "SIM network unlock PIN" or "Enter Network Lock Control Key" screen will appear.
2. Type your Unfreeze code and hit Unlock button. You will get "unsuccessful message" again but don't worry.
3. Now type the Unlock code and hit Unlock button. *If your phone reads "Network Lock Succesful" it worked, but if not, proceed to step 4.
4. If you get "unsuccessful" again then hit Dismiss button and type *2767*3855# on phone keypad. (This will reformat all your data)
5. After phone restarts, type the Unfreeze code when prompted to enter "SIM network unlock PIN" or "Enter Network Lock Control Key" and hit unlock button. It will say "unsuccessful" again, don't worry!
6. Type the Unlock code and hit Unlock button. Your phone should now give you the message "Network Lock Successful".
Now. If this worked for you, you are lucky. Apparently, this did not work for me. When I typed in *2767*3855# the phone did not do anything. I tried factory resetting too by using the E3 boot command and proceeded to step 5 but it still not working. Lets proceed to troubleshooting number 2.
Troubleshooting number 2:
Note: Troubleshooting number 2 needs access to the hidden menu. Since we are running on MK2 hidden menu is disabled. Again, another disappointment. But then again, we can access the hidden menu by flashing MDL modem. So we now go to this link: http://forum.xda-developers.com/show....php?t=2595457 and follow method 2. Download both the modems and you need odin 3.07. Now after flashing the MLD modem you can now access the hidden menu and follow the steps below.
1. Make sure that the phone PROMPTS for the code with a NON accepted sim card.
a. Go to the Dial pad and dial *#197328640# or *#0011#
b. Press the Menu button followed by the Back key. Then, hit the Menu button again and select KEY INPUT. Enter 1 and press the OK button to enter ServiceMode.
c. Press Menu one more time and tap back again. This will pull up the Main Menu for ServiceMode. Tap  UMTS.
d. Now select DEBUG SCREEN, followed by  PHONE CONTROL.
e. From the next screen, pick  NETWORK LOCK.
f. You will see 3 options
g. Please click on number  Perso Sha256 INFO, the screen will change slightly
h. Please hit the MENU button then when the menu pops up please carefully hit BACK to return to the previous screen
i. Next Please click on number  Perso Sha256 ON, the screen will change again to a one line message
j. Restart the phone on the screen by holding the power button and click RESTART (Note: Do not do the NV rebuild, just restart using the power button)
k. When the phone prompts for the unlock code simply enter the unlock code provided to you
l. Your phone is now permanently unlocked!
m. Odin flash the MK2 modem or else you phone will be buggy and wont have sounds.
This is my method of unlocking my S4 MK2 build locked to AT&T. Is it really permanent? I tried to re flash a full MK2 modem from this link: http://forum.xda-developers.com/show....php?t=2621279. After it booted, it never asked for the SIM unlock PIN. I also tried factory reset by using the E3 boot command by holding the volume up+homekey+power button at the same time. After booting up, no prompt for the SIM network unlock PIN.
If ever you hard brick you phone, it is not my fault. I actually did a hard brick when I was doing method 1 from the above link but I managed to fix it by using this link: http://forum.xda-developers.com/show....php?t=2573080.
I hope this works for you as well.
Credit goes to: bvzxa3 and ted77usa. Without their guide I won’t figure this out. Thank you for making my brain bleed a bit. Now I feel like I’m a genius.