Bleach and a scrubbing brush (or toothbrush if you are as pedantic as I am!). Not very healthy or environmentally-friendly, but it really has been the only thing that has worked for me for really stubborn grout (when we moved into a unit a couple of years back I thought the grout was dark grey, only to find out that it was, in fact white and just disgustingly dirty!!).

Pop the bleach on the grout and leave for an hour. Then start srcubbing. Just make sure you have mats and towels down so you don't walk with bleached feet in the house!

Good luck x