Assuming input_boolean.guests_present is off, you have 4 trackers, that’s 16 possible combinations of tracker states. You are testing for 3 combinations.
I’m guessing your catch-all:
{% else %}
script.at_home
Is catching one of the 13 untested state combinations.
What are the sates of the 4 trackers? Are cg, cg1, lt and lt1 all ‘not home’?
The problem with your code is that it doesn’t account for 1 device tracker being home and 1 not. I see this all the time with my stuff. It’s best to combine them. You can do that with a group.
If you don’t want groups, this template will reduce your trackers. The first 2 lines reduce your double device trackers into a single result, either being True if home or False if not (for CG and LT). The 3rd line is just to shorten the if statements length.
{% set cg_home = [ states.device_tracker.cg, states.device_tracker.cg2 ] | selectattr('state','eq','home') | length > 0 %}
{% set lt_home = [ states.device_tracker.lt, states.device_tracker.lt2 ] | selectattr('state','eq','home') | length > 0 %}
{% set guests_home = is_state('input_boolean.guests_present', 'on') %}
{% if not cg_home and not lt_home and not guests_home %}
script.not_home
{% elif cg_home and not lt_home and not guests_home %}
script.cg_home
{% elif lt_home and not cg_home and not guests_home %}
script.lt_home
{% else %}
script.at_home
{% endif %}