The thermometer probe goes inside the cage. Either directly on the glass above the UTH, or on top of the substrate layer directly over the UTH. (inside the cage)
The thermostat probe should be sandwiched between the bottom of the tank and the UTH itself. (outside the cage)