The word goodbye is a derivative of the early English greeting “God be with you,” or as it was said then, “God be with ye.”
Over the years its abbreviated written form and pronunciation became “goodbye.”
As for “so long,” it came to Britain with soldiers who had spent time in Arabic-speaking countries, where the perfect expression of goodwill is “salaam.”
The unfamiliar word to the English men sounded like, and then became, “so long.”