How does a double displacement reaction work?
Double displacement reactions involve ionic compounds, i.e. salts formed from positive cations and negative anions. Consider the following setup,
$$\ce{\color{blue}{A^{+}}\color{red}{B^{-}} + \color{blue}{C^{+}}\color{red}{D^{-}} -&gt; \color{blue}{A^{+}}\color{red}{D^{-}} + \color{blue}{C^{+}}\color{red}{B^{-}}}$$
where the cations are indicated in blue and anions in red (and all charges are $\pm 1$ to reflect your question). All salts are comprised of cations and anions, hence $\ce{\color{blue}{AC}}$ wouldn't form since both are cations. $\ce{\color{blue}{C}\color{red}{B}}$ would form instead.