If you're in the US, you get the unlock code from your carrier once the phone has been fully paid for. Google <your carrier's name> sim unlock (without the brackets)and you'll see the instructions. (If it's not fully paid for, it can cost you from $10-$30 for the unlock code - you can find companies offering the service on eBay.)
After re-reading my answer, jailbreaking and unlocking are different. Unlocking allows you to use a SIM from a carrier other than the one the phone is locked to.
Jailbreaking, called rooting in Android, is getting access to the entire phone, system areas as well as user areas. Your best place for rooting information is the XDA Forums S7 Edge forum, scroll down and choose your carrier, then look for a rooted ROM or information about rooting the stock ROM.