Let’s split the calculation into two cases, hands with the Old Maid and hands without.
A hand with the Old Maid that has exactly two pairs contains the Old Maid, two pairs, and $12$ singletons. Such a hand therefore has cards from $12+2=14$ of the $25$ denominations. There are $\binom{25}2$ ways to choose the denominations of the two pairs, and there are then $\binom{23}{12}$ ways to choose the denominations of the $12$ singletons. For each singleton there are $2$ ways to choose which member of the pair we get. Thus, there are $2^{12}\binom{25}2\binom{23}{12}$ hands of this type.
Now see if you can modify that calculation to get the number of hands of the desired type that do not include the Old Maid.