If you owned and lived in the house for two years out of the five years preceding the sale, it doesn't matter why you moved or where your job is. You qualify for the full exclusion of capital gain.
If you did not own and live in the house for two years out of the five years preceding the sale, you do not qualify for the full exclusion. You might qualify for a partial exclusion if you sold the house because of a change in job location. But that requires that you either took a new job or were transferred to a new location. If you keep the same job, in the same location, the distance from your job does not qualify you for a partial exclusion.