Erdogan was in-country the whole time.
You’re right, he was in the country. He was reportedly in Marmaris, safely away from Istanbul and Ankara.