Firstly you want to make sure you have the correct drivers installed for your phone, which shouldn't be an issue if you already tried rooting through Odin you will then need to download official stock Rom from Sam mobile, make sure it's the correct one for your device(you should have taken note of firmware prior to rooting?) Then follow this guide I copied from elsewhere..
Then you open Odin and follow this guide I copied(because it's a stock Rom and not just a kernel your flashing, you'll need to replace the .tar file with a .md5 file as seen in the file downloaded from Sam mobile. If in doubt it'll probably be the one that has the biggest file size....
With Odin displayed on your PC screen, click on the PDA button and navigate to the .tar file, that you placed on your home screen, and select it.
Make sure that Re-Partition is unchecked and that Auto Reboot, F.Reset Time and PDA are checked and that the PDA box now contains your .tar file.
#2.3. Step 3.
Connect your phone, still in Download mode, to the PC using the USB lead. If you have successfully connected to Odin you should see the ID:COM box in Odin turn yellow or light blue, (depending on which version of Odin you are using).
#2.4. Step 4.
In Odin click the Start button and you should see a green progress bar above ID:COM and shortly after that the box above it will turn green with the word PASS! in it and your phone will automatically reboot.
As I said,I copied the final parts from another guide(on rooting rather than flashing stock Rom, but it's the same thing just different files selected!)
Good luck :-)