Default Xperia Z2 waterproof IP55/58

Hi
Xperia Z2 is waterproof and dust resistent (to grate extent)
Sony says it has IP55/58 rating.
What does it mean?
How the same phone can have two ratings IP55 and IP58
Or does it mean something else?
Also galaxy S5 has IP67 rating. So are these ratings better than those of Z2?

Thnaks in advance!!