Dynamics of deterministic and stochastic multi-group MSIRS epidemic models with varying total population size