1: download adb platform tools from here
2: Unlock bootloader. follow the guide on htcdev.
make sure you have htc drivers installed so that you can use oem command in fastboot mode for unlocking
3: Download TWRP
4: Download SuperSU and copy it to your phone's internal memory
5: Enable USB debugging and type "adb reboot-bootloader" from pc
6: Type: "fastboot boot twrp-3.1.1-0-alpine.img"
make sure you have twrp image in same folder as adb.
7: Wait for sometime you will boot into twrp recovery from there select install and select the SuperSU zip file
8: reboot and check for root