Multiplayer video games are high-involvement products with multiplatform and multiplayer characteristics which aim to enhance player retention by optimizing the matching of teams in accordance with their skills and attributes. However, relatively little academic research has been conducted into the ways in which player attributes can be used to optimize the formation of teams in multiplayer video games. Our study addresses this deficiency in the literature by analyzing a dataset from a popular online multiplayer game that includes historic behavioral data of 6.9 million players participating in 862,664 unique game rounds. We analyze the observable factors associated with longer duration of participation in each round, finding that player retention improves in the presence of player-versus-player combat, variety and heterogeneity. We also show that player retention diminishes as a result of the absence of particular role or vehicle use within a given round. Based on the findings of the analysis, we develop a novel approach called nested matching to assign players to teams with an optimal mixture of skills and inherent and complementary attributes.