Major facilitator superfamily (MFS) proteins operate via three different mechanisms: uniport, symport, and antiport. Despite extensive investigations, molecular understanding of antiporters is less advanced than other transporters due to the complex coupling between two substrates and the lack of distinct structures. We employ extensive (~300 μs) all-atom molecular dynamics simulations to dissect the complete substrate exchange cycle of the bacterial nitrate/nitrite antiporter, NarK. We show that paired basic residues in the binding site prevent the closure of unbound protein and ensure the exchange of two substrates. Conformational transition only occurs in the presence of substrate, which weakens the electrostatic repulsion and stabilizes the transporter by ~1.5 kcal/mol. Furthermore, we propose a state-dependent substrate exchange model, in which the relative spacing between the paired basic residues determines whether nitrate and nitrite bind simultaneously or sequentially. Overall, this work presents a general working model for the antiport mechanism within MFS family.