Understanding microbial community dynamics to improve optimal microbiome selection