This method will teach you how to root the Samsung Galaxy Grand Prime running android lollipop 5.1.1. I tested this root method on SM-G530T and it worked perfectly. A user has told me that it works on SM-G530P.
Flashing instructions:
* Put Phone in Download mode and download this file (SM-G530T) or this (for SM-G530P).
* Open Odin
* Connect Phone
* Put Kernel in AP Slot
* Flash file
* Reboot
Now download supersu from playstore. In case, your grand prime does not boot on first boot, pull out the battery and reboot. You do not need CWM or TWRP for grand prime to root your device but it is recommend to have custom recovery as only after that you will be able to flash custom ROMs on it.
Stock recovery does not allow users to flash any custom firmware.