It depends on the situation. In general, though, these are the phrases to use:
For friends:
안녕(ahn-young) or simply "'Bye" will suffice.
For others:
안녕히게세요 (ahn-young hee gae-sae yo) if you are leaving, and they are staying.
안녕히가세요 (ahn-young hee gah-sae yo) if you're staying, and they're leaving.
For friends:
안녕(ahn-young) or simply "'Bye" will suffice.
For others:
안녕히게세요 (ahn-young hee gae-sae yo) if you are leaving, and they are staying.
안녕히가세요 (ahn-young hee gah-sae yo) if you're staying, and they're leaving.