I have following situation. No good quality phd is available in my country (field: computer Science). On the other hand leaving my country for too long is also a little bit difficult for me mainly for family situation. My question is: is it not possible that I negotiate somehow with possible supervisors etc. that I do some part of my Phd remotely? Or say I visit the University for 6 month, then next 6 month I will spend in my country, etc. Or similar arrangements. I know sometimes they call such programs also Sandwich phd programs. Field is computer science so I don't need to be there in some "lab" all the time. Do you know if this is possible? And where/how can I find such programs? Who do I have to "negotiate" it with and how?
Let me give you a different perspective to your question.
No good quality phd is available in my country
It is good that you aim high. But you must see things through the PHD admissions' perspective. Good universities and good PHD programs have a lot more candidates than PHD positions. Why should they choose you over the other candidates? Is your undergraduate research work that good? Are your grades excellent? Is your university reputable (probably not). If the answer to these questions is no, then the main issue is that you would not get accepted to these programs anyway, regardless of your plan to do it remotely or not.
Also do you have a MSc degree? In many countries in Europe you need a MSc degree before doing a PHD and in USA you need to pass some courses before conducting the actual PHD research. This simply (in either case) cannot be done remotely
Also from your comments I understand that you also want to have funding during your PHD (you would also agree to a reduced funding). In other words, you want someone to hire you (and pay you) to do research, coming from an unknown university, remotely, without actually having a first hand experience of how you can perform at this level, coming directly from an undergraduate university and with no industrial real-world work experience. This is too big a bet for any advisor and university to undertake, unless you have already proven yourself as an extremely talented individual. In that case, exceptions may be possible but still a remotely done PHD is still a major gamble for the advisor and the univesity. Without funding the stakes are smaller but as @xLeitix said remote PHDs do not always work that good. But I think expecting funding for a remote PHD is highly unrealistic.
The only solution I can think of, is for you to work a couple of years on site for a PHD (if you get accepted to a good PHD program) and after proving your worth there (with some good publications) during the second-half / dissertation writing portion of your PHD you can ask / convince your advisor to work part-time / remotely from your home country.
Yes, this can be done, but this has to be discussed with the school and program in advance. At previous work places, I've seen PhD students on site who were working "remotely" essentially full-time. Usually, for this to work, you need to have a "local" supervisor who is known to the PhD advisor who will be able to oversee your work.
One other important note: you will most likely be required to spend at least a certain portion of your time at the degree-granting institution, as most schools have some sort of "residency" requirement.