Global dynamics of a multi-group epidemic model with general exposed distribution and relapse