annyeonghaseyo, annyeong, annyeonghi gyeseyo (when you are the one who's leaving)/annyeonghi gaseyo (when you are the one who's staying), annyeong. -- note that when everyone's leaving -- and no one's staying -- you use the first one -- annyeonghi gyeseyo.