One way to look at it is counting. Of the 52 choose 5 possible hands, how many are two pair? There are 13 numbers in a deck. The two pair are any 2 of these 13 numbered cards, so 13 choose 2. For each pair, there are 4 cards to choose from; we're taking 2. So (4 choose 2)2. The fifth card is anyone of the 11 remaining numbered cards, and anyone of the four suits. So (11 choose 1)*(4 choose 1). Altogether, this is ##\binom {13} 2 {\binom 4 2}^2 \binom {11} 1 \binom 4 1## hands that contain exactly two pair. Dividing by ##\binom {52} 5## yields the probability of two pair, 198/4165.
Another way to look at it is to compute the probability of getting a pair in the first two cards, a different pair in the next two cards, and an unrelated card on the last card. The probability of this particular hand is ##1\cdot \frac 3 {51} \cdot \frac{48}{50} \cdot \frac 3 {49} \cdot \frac {44}{48} = \frac {66}{20825}##. That isn't the only way to be dealt two pair. With this approach one has to look at the number of ways we can be dealt an equivalent hand, and one has to be careful in doing so. That unrelated card can be anyone of the five cards, so this multiplies the probability by five. The four paired cards is where one needs to take care. There are six permutations of {A,A,B,B}, but multiplying by six would be over counting. {B,B,A,A} is the same as {A,A,B,B}. Fixing the first card, there are only three permutations of {A,B,B}. Thus we need to multiply the probability of that specifically ordered hand by 15, yielding 198/4165.