If I configure geofence enable and set max altitude 1000 meter
My waypoints are planned in terrain altitude mode then AP will consider the AGL above the takeoff point or altitude above the terrain it will consider “ALT is breached “
AP Copter fences are all relative to the home location. There’s an item on the to-do list somewhere to allow supporting fences as “above terrain” but it’s not complete yet (nor is anyone actively working on it as far as I know).
If RTL_ALT_TYPE is set to 1(terrain) then it will use terrain following to get to the rally point. Remember that you can always test this yourself using Mission Planner’s built in simulator.