Let $A$ be the event in which a burglary is going on, $B$ the event in which the alarm is triggered. We then find:
$$P(B) = P(A) P(B | A) + P(\lnot A) P(B | \lnot A) = 0.0005 \cdot 0.99 + 0.9995 \cdot 0.002 = 0.002494$$
Using Bayes' theorem, we find:
$$P(A | B) = \frac{P(A \cap B)}{P(B)} = \frac{0.0005⋅0.99}{0.0005 \cdot 0.99 + 0.9995 \cdot 0.002} = \frac{0.000495}{0.002494} = 0.1985$$