How to determine which ions will pair to form a compound in an aqueous solution?

Let us assume we have an aqueous solution with the ions $\ce{A+}$, $\ce{B+}$, $\ce{C-}$ and $\ce{D-}$. Which ions will form a bond and why? Will the compound formed be $\ce{AC}$ and $\ce{BD}$ or $\ce{AD}$ and $\ce{BC}$?

Is there any general rule to identify the compounds we have at the end?

Though, another possibility is of precipitation. In that case, the ions involved ($\ce{AD}$ for example) would separate out of the solution and settle down as a solid. Indeed, there may be more than one possible precipitates. So, to decide between any given number of compounds, as to which precipitates first, we'll need to check if their ionic product exceeds their $K_\mathrm{sp}$. The compound for which this happens earlier, due to lower $K_\mathrm{sp}$, would precipitate earlier.
Whether $\ce{A+}$ would combine with $\ce{C-}$ or $\ce{D-}$, would depend on their energy of interaction $\left(=\displaystyle -\frac{Kq_1q_2}{r}\right)$. More the energy released for a particular bond, more would be the probability of formation of that bond.