In nucleon-nucleon interactions of n-n, p-p, n-p how do you determine which pion is the mediator?
None of them. All of them (and the rho and eta, too). It doesn't matter and doesn't have a unique answer as the meson exchange idea is an effective theory.
If you insist on trying to write down rules, then charged pion exchanges can only occur between protons and neutrons resulting in the nucleons exchanging types. On the other hand neutral pions can be exchanged between any two nucleons. The heavier mesons can also participate, but their contribution will be smaller at all ranges and they range out sooner.
Welecka spends a few sections on computation using this model in his Nuclear Physics text.