First of all, they're finite sums, so $$\sum_i\sum_j=\sum_j\sum_i.$$ That is, we can always invert the order of summation.
The second thing to note is that $$\sum_i\sum_j a_ib_j =\sum_i a_i \sum_j b_j$$
To see this, note that the right-hand side is $$(a_1+\cdots+a_n)(b_1+\cdots b_m)$$ To evaluate this, we choose one of the $a$'a and one of the $b$s, and take their product. We add up the products over all choices of $a$ and $b$. That's exactly what the left hand side says.
So take $\sum_i\sum_j$ of both sides of the given equation; distribute the summation by linearlty; apply the two observations above to massage the equation into the desired form.