Actually, traditionally "güle güle" is only to be used by the person who stays behind. The person who is leaving says: /alasmaldık/ (abbreviated pronunciation of "Allah'a ısmarladık").
But the latter one is falling out of use, as of late. And there are people (like myself) who use "güle güle" in both cases just to keep things simple. "Güle güle" is a friendly expression, but it is usable in formal contexts as well.
Or just use Hoşça kal / Hoşça kalın all the time if you want.