Upvote:1
The European Court of Justice said in Wegener v. Royal Air Maroc, ECLI:EU:C:2018:361 earlier this year that the EU air passenger rights keep applying after a layover outside EU/EEA, when the entire journey was booked together.
This covers journeys that originate in the EU/EEA.
For journeys towards the EU/EEA, the EU air passenger rights only apply if the airline is based in the EU/EEA, which will rarely be the case for flights with a layover outside the area. This is independent of where the ticket was bought.