*First download the two links given below.
*Transfer them to your SD Card.
*Power off the phone.
*Hold Power button+volumeup+home button at the same time till you see the samsung logo, release them once you see that.
*Go to Advance by using volume buttons & select any option with power button. Once you open the advanced, select wipe data cache.
*Go back and wipe user data/factory reset.
*Now, go to install from sdcard/external sdcard where you have transferred the two files. select cm12 fill and select install. After that again go to install from sdcard/external sdcard & select gapps, Install them.
*After performing all the steps reboot the phone & complete the setup.
If you have any questions regarding this tutorial just leave us a comment and we will get back to you soon.