In order for your PC to recognize the Samsung Galaxy On5 as part of the rooting process you first must download and install the USB drivers on to your PC.
Once you have downloaded them run the main program file to make sure the drivers are installed.
Step 2 Download the Odin rooting program
In order to root the Samsung Galaxy On5 using the root file given in the next step you must first download Odin which is what will be used to install the root file onto the Samsung Galaxy On5 and perform the rooting process.
You can download Odin from here.
Once downloaded extract the file to a convenient location such as the desktop.
Step 3 Download the Samsung Galaxy On5 root package
Now that we have installed the Samsung Galaxy On5 USB drivers and downloaded Odin we now need to download the root package to be used for the rooting process.
Make sure you save it in an easy to find location such as the desktop and extract it to its own folder.
This gives you a .TAR file.
Step 4 Enable USB debugging on the Samsung Galaxy On5
In order for your PC to recognize the Samsung Galaxy On5 when you plug it in to perform rooting you must first enable USB debugging on the device itself. This is done by doing the following.
Tap the Settings option.
Tap the About Device option.
Keep tapping the Build Number option (seven times) until it says you are a developer.
Tap the new Developer Options menu that appears.
Make sure that the USB Debugging option is checked.
Step 5 Root the Samsung Galaxy On5
Now that we have all we need it is time to root the Samsung Galaxy On5. Before we can do that you must first put the Samsung Galaxy On5 into Download mode which can be done using the following steps.
Make sure the Samsung Galaxy On5 is powered off completely.
Hold down the Volume down key and the Home key and the power button and keep all three buttons pressed until the Samsung Galaxy On5 powers up.
Providing you have done it correctly it should boot into Download mode and you press the Volume up key to start Download mode.
Connect the Samsung Galaxy On5 now to your PC.
Run the Odin software you downloaded in step 2.
Inside Odin click the AP/PDA option and browse on your computer to the .tar root file you extracted in step 3.
Inside Odin click Start to begin the root process.
The process will take a few moments after which the Samsung Galaxy On5 will restart itself and complete the rooting process Do not remove the Samsung Galaxy On5 from your PC during this time.
Once the Samsung Galaxy On5 starts up properly copy you must then reboot into recovery mode.
Make sure the device is turned off completely.
Hold down Volume Up + Home + Power until the device turns on and boots into recovery mode.
Now, with the device in recovery mode it will be the custom TWRP recovery you just installed.
The recovery will display a message asking if you want to root the device.
Slide to install SuperSU and root the device.
Once done return to the main menu and then reboot the device.
Once the device has rebooted normally you should see the SuperSU notification on the device.
Tap it to complete installing SuperSU and the device should be rooted.