You can use a truth table, or you can just argue that both sides have the same truth value. Here's a sketch:

The left is true

iff

(p iff q) and (r iff q) are both true

iff

p, q have the same truth value AND r,q have the same truth value

iff

p,q and r have the same truth value

iff

p, r have the same truth value

iff

the right hand side is true.

Remarks: (1) iff stands for "if and only if"

(2) I did this very quickly, so make sure that all these steps are reversible. If there is an error it should be easy to correct - the basic idea is sound (I'm running out of the house now or I would check it more carefully).