1. Download Samsung USB Drivers, CM, Odin3, gapps and CWM or any similar custom recovery. 2. Install Samsung USB drivers on your pc 3. Put Gapps and CM on your microsd card 4. Put your phone in download mode and connect it to your pc 5. Start Odin 6. Select CWM or your custom recovery as PDA in ODIN (Don't change any settings) 7. Start the upload 8. After it's finished and odin says "ok" start your phone in recovery mode 9. Perform a full wipe (Cache, Data, Dalvik Cache) (From this point on all your data is void so make sure you have a backup of your data). OBVIOUSLY DON'T WIPE YOUR MicroSD CARD 10. Go to install and search for your CM. 11. Install CM 12. Go back to install and install GApps 13. Install Gapps
Remember that ]by installing CM your phone also will be rooted! Do not install something like SuperSU afterwards.
Edit: Also make sure that you got the correct CM and custom recovery for your phone. If you install something wrong it either won't install or you will brick your phone. Also your trianglecounter will go up. You could use triangleaway after installing CM but TriangleAway also could brick your phone.