Abstract When two planets are born in a protoplanetary disk, they may enter into mean-motion resonance as a consequence of convergent planetary migration. The formation of mean-motion resonances is important for understanding how planetary systems are shaped in disk environments. Motivated by recent progress in the comprehension of the migration of partial gap-opening planets, we have investigated the orbital evolution of planet pairs in a wide range of masses and disk properties with the aim to find out when resonance capture is likely to happen. Using the formula for the migration timescale of a gap-opening planet developed in our previous work, we have derived a simple criterion that allows us to predict when the migration will be convergent (divergent). Further, we have verified the criterion using two-dimensional hydrodynamic simulations. We have found that the resonant pair of planets formed at the early phase of evolution can depart from resonance at later times because the migration speed of the outer planet slows down due to gap formation. Moreover, adopting our formula for the migration timescale, we have also carried out three-body simulations, which confirm the results of hydrodynamic simulations. Finally, we have compared our predictions with observations, selecting a sample of known two-planet systems.