Subaru overheating

Ok first let me start and say I know nothing about cars. I have a 96 subaru outback 2.5 L. it is overheating. The check engine light came on and I had it checked and it is the Coolant Tempature Sensor. It overheated before the light came on. I have replaced the radiator cap and the Thermostat. There doesnt look like there is oil in the water. It will only overheat while driving not while ideling. I dont belive there are bubbles in the overflow. So could someone tell me its not the headgaskets?

So there’s no oil in the coolant; that’s good, but what about the other way around? Is there coolant in the oil?

You may or may not see bubbles in the overflow tank, but a surefire check is to test the coolant for the presence of exhaust gases.