Either he didn't go there directly and they "hopped" there after finding out, when they arrived on Earth.
OR....Thor's a hyper-advanced being. It could be that the Stormbreaker has some sort of homing ability to the TesaractTesseract stone of power and that's how Thor knew EXACTLYexactly where to go.