Combining AND/OR

I am wanting to create an automation with the following function

(trigger = 1 AND phone = home AND light = off) OR (trigger = 2 AND time between 9:30PM-12:00AM AND light = off)

Is this correct?

condition: or
conditions:
  - condition: and
    conditions:
      - condition: trigger
        id: '1'
      - condition: device
        domain: device_tracker
        entity_id: device_tracker.phone
        type: is_home
      - condition: device
        type: is_off
        entity_id: light
        domain: light
  - condition: and
    conditions:
      - condition: trigger
        id: '2'
      - condition: time
        after: '21:30:00'
        before: '00:00:00'
      - condition: device
        type: is_off
        entity_id: light
        domain: light

Looks right. You should probably give the triggers (not shown in your post) proper ids though, to make it easier in the future when you might want to edit it.