How to sense 24V AC (Thermostat) with a 5V Microcontroller
The schematic for use of HPCL3700 is provided in the HP Application Note AN 1004, Figure 6:



The same section of the application note provides the calculations for determining Rx and thus the values of the two resistors on the input side, Rx/2 each, based on the desired trigger threshold (see Example 2). A graph to directly obtain Rx values is provided in Figure 7.

For monitoring a 24V AC line and with some margin for low voltage conditions, referring to Figure 7 and considering high and low thresholds of around 25 and 15 Volts yields Rx = 20k: use 10 kOhms 2 Watts resistors to be on the safe side, one on each leg i.e. pin 1 and 4. 

If you also plan to monitor 110V mains voltages, the values used would be 18k 2 Watts each. Ensure that the resistor used is rated for AC mains operation, not the common or garden variety which is not safe for mains voltage applications.