If you want to go back to stock, you can follow this Odin guide
and install the UVUAMDL stock rom.
It sounds like you are on the MDL version. You can go to settings > the more tab > scroll down to about device, and see what it says under baseband version and build number, It will probably be M919UVUAMDL.
When you installed TWRP it sounds like it didn't stick and the recovery you went to was the stock recovery. If you want to root with TWRP, follow this guide
. When Odin is done and your phone starts to reboot, hold your up volume until you see the TWRP menu.
Download this kernel
. Thanks to mattlgroff in this thread
. Put the kernel on your sd card. Download SuperSU
and put it on your sd card. Go to TWRP and tap 'Install'. Navigate to those 2 files and install them. Reboot and now your rooted on the stock rom.