When you use distillation to separate water from dissolved sugar, the phases that water goes through are: from a liquid to a gas, and back to a liquid.
During distillation, the liquid (water) is heated to its boiling point, turning it into vapor (gas). This vapor is then cooled and condensed back into a liquid, effectively separating it from the sugar, which remains in the original container.