Ecological communities are assembled in a spatial-temporal continuum. However, we still have a poor understanding of the relative importance of different mechanisms structuring community composition (i.e. beta-diversity) in space and time. In this study, we start by introducing a conceptual model that capitalizes upon the core-occasional species concept to predict that the assembly process in tropical mountains is driven by the deterministic turnover of core species in space via habitat sorting, but the turnover of occasional species through time via stochastic events of colonization and local extinctions. We then propose a general analytical framework that allows assessing these predictions by partitioning the total variance of a species-by-site-by-time matrix (i.e. total beta-diversity) among its purely spatial (variation in space independent of time), purely temporal (variation in time independent of space) and spatiotemporal (i.e. variation across different sites across different moments in time) components. Through simulation models, we provided theoretical support that the proposed analytical framework is suitable to test the predictions derived from our conceptual model. We then used this framework to identify general patterns and quantify the relative importance of processes underlying the spatial and temporal organization of ten distinct insect metacommunities along a tropical elevational gradient. As predicted, we found that, across taxa, spatial beta-diversity was mainly explained by environmental variation alone: a pattern that indicates the spatial turnover of core species. In contrast, temporal beta-diversity could not be distinguished from the expectation of null models where communities are simply represented by random draws from species pools: a pattern that indicates a temporal turnover of occasional species within communities. Taken together, our findings illustrate how our conceptual model and quantitative framework can articulate a better understanding of community assembly in space and time.