Both.
But when you put liquid water in space — where it can no longer remain as a liquid — which one of these two things happens? Does it freeze or boil?
The surprising answer is it does both: first it boils and then it freezes! We know this because this is what used to happen when astronauts felt the call of nature while in space. According to the astronauts who’ve seen it for themselves:
When the astronauts take a leak while on a mission and expel the result into space, it boils violently. The vapor then passes immediately into the solid state (a process known as desublimation), and you end up with a cloud of very fine crystals of frozen urine.
Does water freeze or boil in space? [Ethan Siegel/Medium]
(Image: ISS-38 EVA-2 (c) Mike Hopkins, public domain)