To root your your firstly you need to install TWRP recovery on your device.
Download the SuperSU Zip.
Now move zip file into your SD Card.
Now Boot your Z3 in recovery mode. To do this Switch off your Xperia Z3 first, Switch it back on and the time when you see your phone’s LED notification light turn Pink! (or any other color) — start pressing either the Volume UP or Volume Down key a couple of times to make your phone boot into recovery mode.
Once your phone in recovery mode, Tap on Install » browse to the location where you saved the supersu zip files and tap on it.
Now at the bottom of the screen, do a swipe on the Swipe to confirm flash option to begin flashing.
This will start the flashing process on your phone and take some time to finish.
Go back to the main menu of recovery and tap on Reboot » then, tap on System to reboot your phone.
Now your phone is rooted successfully. For brief view you can check manual.