Prerequisites: unlocked bootloader, TWRP recovery.
1.First you need to download SuperSU.
2.Enter TWRP recovery via the advanced power menu (or power + volume down).
3.Select the install option from the TWRP home screen.
4.Navigate to where you have SuperSU stored on your sd card and select it.
5.Swipe to install.
Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.