You talking about unlocking it from the carrier or unlocking the bootloader on the device?
Unlocking the bootloader is basically tied in with rooting the device.
Unlocking from the carrier, that requires you " the proper way " to buy the device outright from the carrier or finish your contract agreement the obtain the unlocking code & procedure from the carrier.
There is other ways of unlocking from the carrier but we don't condone that due to scams and other problems.
Is the phone in good standing with the previous owners carrier? No contract owed, skipped out on, etc. ? You should be able to get the unlock code from the previous carrier then.