Find all positive integers $p$, $q$, $r$ such that $p$ and $q$ are prime numbers and  $\frac{1}{p+1}+\frac{1}{q+1}-\frac{1}{(p+1)(q+1)} = \frac{1}{r}.$
1. Start with the given equation:
   \[
   \frac{1}{p+1} + \frac{1}{q+1} - \frac{1}{(p+1)(q+1)} = \frac{1}{r}
   \]

2. Combine the fractions on the left-hand side:
   \[
   \frac{1}{p+1} + \frac{1}{q+1} - \frac{1}{(p+1)(q+1)} = \frac{(q+1) + (p+1) - 1}{(p+1)(q+1)} = \frac{p + q + 1}{(p+1)(q+1)}
   \]

3. Set the combined fraction equal to the right-hand side:
   \[
   \frac{p + q + 1}{(p+1)(q+1)} = \frac{1}{r}
   \]

4. Cross-multiply to clear the fractions:
   \[
   r(p + q + 1) = (p+1)(q+1)
   \]

5. Expand the right-hand side:
   \[
   r(p + q + 1) = pq + p + q + 1
   \]

6. Subtract \(p + q + 1\) from both sides:
   \[
   r(p + q + 1) - (p + q + 1) = pq
   \]

7. Factor out \((p + q + 1)\) on the left-hand side:
   \[
   (r - 1)(p + q + 1) = pq
   \]

8. Since \(p\) and \(q\) are prime numbers, consider the possible values for \(r\). Note that \(p + q + 1 > \max\{p, q\}\). The simplest case to check is \(r = 2\):
   \[
   (2 - 1)(p + q + 1) = pq
   \]
   \[
   p + q + 1 = pq
   \]

9. Rearrange the equation:
   \[
   pq - p - q = 1
   \]

10. Add 1 to both sides:
    \[
    pq - p - q + 1 = 2
    \]
    \[
    (p - 1)(q - 1) = 2
    \]

11. Solve for \(p\) and \(q\) by considering the factor pairs of 2:
    - If \(p - 1 = 1\) and \(q - 1 = 2\), then \(p = 2\) and \(q = 3\).
    - If \(p - 1 = 2\) and \(q - 1 = 1\), then \(p = 3\) and \(q = 2\).

12. Therefore, the only solutions are:
    \[
    \{p, q\} = \{2, 3\} \text{ or } \{3, 2\}
    \]

The final answer is \( \boxed{ \{p, q\} = \{2, 3\} \text{ or } \{3, 2\} } \).