Some help with automation needed

I’m really new in HA, but i would like tot set my nest thermostat to set the state to Away when i’m leaving the Home Region.

and set it to Home when I would leave work or work_2 region. (so it will start heating)

can somebody help me a little hand?

automation:
  alias: zet nest op afwezig.
  trigger:
    platform: zone
    entity_id: group.all_devices
    zone: zone.home
    event: leave
  action:
    service: climate.set_away_mode
    entity_id: climate.family_room

is this oke?

Everything looks OK as far as syntax and order.