The Levins model is a simple and widely used metapopulation model that describes temporal changes in the regional abundance of a single species and has increasingly been applied to metacommunity contexts including multiple species. Although a fundamental assumption commonly made when using the model is that species randomly move between habitat patches, most organisms exhibit habitat preference in reality. A method of incorporating habitat preference (directed dispersal) into the Levins metapopulation model was developed in a previous study. In the current study, we extended the approach to explore two-species metacommunity dynamics (i.e. competition and predation) mediated by habitat preference. Our results theoretically revealed that coexistence of competing metapopulations requires conspecific aggregation and heterospecific segregation whereas the conspecific segregation of prey and effective avoidance of unsuitable prey-free patches are crucial for persistence of predator metapopulations. In addition, we qualitatively and quantitatively demonstrated the effect of habitat preference on the outcomes of interspecific interactions. The present study opens a new research avenue in metacommunity ecology in complex nature and contributes to improved landscape management for the conservation of species (e.g. territorial and group-living animals) and biodiversity.