The Galaxy S5 is yet to go on sale in a majority of the markets but that has not stopped Chainfire from gaining root access on the device. Chainfire has always managed to root any new flagship Galaxy S handset from Samsung even before the device hits the shelves and the Galaxy S5 is no different.
The rooting procedure is the same as any other Galaxy device and requires the use of ODIN to flash a CF-Auto-Root package. The catch, however, is that the rooting process is only compatible with the SM-G900F variant of the Galaxy S5, which comes with an unlocked bootloader. Sadly, this method will also increase the flash counter as well as trip the KNOX switch on your Galaxy S5.
The carrier variants and European variants are yet to be rooted, mainly because Chainfire is yet to get his hands on the device. If you are lucky enough to already get yours hands on the Galaxy S5, head over to this thread on XDA for the download link and flashing instructions.