For Android 5.1.1, you will need to install a custom kernel to root your Galaxy S6 or S6 Edge. This is because due to how the Android 5.1.1 has evolved and blocks root through normal method.
Before installing the kernels, make sure to go into Settings->About device and press on the Build number about 5 times until it says you have enabled developer mode.
Then hit the back button, select “Developer options” and make sure “OEM Unlocking” is turned ON.
Download root kernels for your device here:
Root Kernels for Galaxy S6
Root Kernels for Galaxy S6 Edge
Simpl Kernel for Galaxy S6 Edge SM-G925F, SM-G925I, T-Mobile SM-G925T, Canadian SM-G925W8, and should work with other variants also but haven’t tested (should be safe to flash, just make sure to have stock firmware handy). – Link – Credits