No discussion of legality can be complete without mentioning the July 1974 coup, and the Greek government's role in it. This willfully provocative act destroyed any possibility of consensus.
There is a nuance between first and second operations in July and August. While occupation in second operation is pretty much an over reaction, first one was quite legal and necessary from the Turkish point of view. Greek state was in a turmoil and nationalists were trying to 'get the Cyprus back'.
I see no nuance. Turkey used the situation to further their own agenda. They have stayed in Cyprus long after their presence could possibly be justified.
Erdogan pulled the same trick to cement his authority with the recent 'coup' in Turkey.
Sorry, none of them were legal. This was pure and simple the idea of the Turks being unhappy with Greek Cypriot rule. Source: lived in Cyprus for 5 years.
Wasn't there terror attacks against British and Turkish on the island -not only on Turkish people, Greeks felt like island 'rightfully belonged to them' -? Wasn't there attempts to unite island with Greece at times by the both Greek and Cypriot nationalists ? There was a guaranteering agreement precisely for this reason and Turkey used his rights.