I am just finishing my master in computer science in France. but the problem that I have a hard situation, I must go to my country many times and staying for a bit long time so I cannot stay all the year in Europe. I can stay three months in Europe and three months in my country and so on.. and to make the situation harder I cannot have a contribution between a university from my country and a university in Europe because the sanctions on my country. So I am searching for advice to do a PhD while I can go and return between my country and Europe. Because as I know in France it is not possible in the rules that I could be outside the lab for three months.
There are definitely universities in Europe that allow you to be physically away from university for extended periods of time during a PhD. In fact, I would be surprised if you cannot find one in France.
I think a bigger problem than the actual rules, both for a potential supervisor and for yourself, is that it sounds like you might be too preoccupied with your external situation to do an excellent job as a PhD student.
Have you considered options for resolving your situation before you start your PhD? Maybe work in a temporary research position while you are trying to resolve it?