When you use distillation to separate water from dissolved sugar, water goes from a liquid to a gas (during the evaporation phase) and then back to a liquid (during the condensation phase).
Therefore, the correct response is:
from a liquid to a gas, and back to a liquid.