'98 S70 Won't stay running.

I have a 98 S70 that won't stay running. I got it with a blown head gasket. I replaced that and it ran great for about three months. Now it will start and run until it reaches normal operating temperature, then it chugs like it's not getting gas and dies it will not restart for several hours after that. There is no odd colored exhaust until it chugs, then the exhaust is white. I an not a mechanic, so the head gasket being bad is a possibility, but any ideas? Thanks in advance.

I agree, do a search and look up testing and or replacing the engine coolant temperature sensor. It is not hard at all and not very expensive either. FYI, white smoke is usually a sign of unburned fuel.

Ok, so the temp sensor I got from Amazon was the wrong one. I tried to check some stuff anyway. I started the car and let it come up to operating temp. It sputtered again, but it stayed running. I was driving when it died before, so it was under throttle. This time, when the thermostat opened, and the engine cooled a bit, it started running rough, but once the temp came back up, it ran ok. I drove it around for a few minutes and it did fine. So there is a problem, but not the one I thought what could cause that?

Sorry updating took so long. I changed out the CTS, which was about three tomes harder than it needed to be. The Torx bolts on the thermostat housing stripped for me. Anyway. I got it put in and will run now at any temp. However it stutters under acceleration, and will die if it sits idling for more than two or three minutes

Is the check engine light on? If so, read the codes and we can go from there. Otherwise I would suggest a full tune up with new plugs (Volvo OEM) plug wires, air and fuel filter, and possibly a new coil. Also, I would clean the butterfly in the throttle body.