I think there are 3 temp sensors, one for the gage, one for the computer (ECT) and another one for the cooling fan control.
The gage one is located as noted above. The gage wire goes through the firewall and to a connector that connects with the harness that plugs into the gages.
The ECT sensor has at least 2 wires, and is connected to the engine harness, and goes to the puter on the pass side.
The fan sensor is wired to the IRCM or CCRM, which is the cooling fan and ac control module. Not sure if it has one or two wires at this moment.
The autozone has pretty decent wiring diagrams. Note that the 4 cyl wiring varies a bunch by year. Your 87 is most likely somewhat like my 89, and has the IRCM version of the module under the dash to the left of the steering wheel.