The loop rule is that the potential difference by going on in a loop is zero.
Going around the loop to the left, assuming the current i1 is going clockwise on the left part of loop and i3 is going up for the middle part of the circuit:
E1 - i1R1 +i3R2 -E2 -i1R1 = 0
You can get the equation for the second loop the same way.
Then you can use i1 -i2 = i3 (junction rule) to get three equations, three unknowns (i1, i2, i3)
It is important you understand how the equation resulting from the loop rule is obtained. When you move along the current across a resistor, you lose I * R in potential difference, and when you move opposite to the current, you gain I * R in current. For batteries (Emf), it's the opposite, you gain potential difference when you're moving with the battery's arrow, and negative when you're moving against (current does not matter here).
Please note this is just a trick and what is really happening in the circuit is not exact.