I keep getting error that the remote teamviwer is running an old version that is out of date.
And cannot connect anymore.
This computer runs with windows xp because of the program it has to run.
That's intended behaviour. You can't connect, because Windows XP doesn't support Teamviewer 15. The free license works only between latest Teamviewer versions - v15 as for now. When they release Teamviewer 16, v15 will turn into legacy and stop working for free as well. If you need a functional connection to the legacy versions, you have to buy a commercial license. Or find alternative software, there's nothing else you can do.