The common column are B and D, so rows from both sides are matched if they have the same B and D values.
The common (B,D) values in this example are (1,a) and (2,b).
2 rows from r' with (1,a) are matched to 2 rows from s', creating 4 combinations.
1 row from r' with (2,b) is matched to 1 row from s', creating a single combination.
Therefore, 5 rows in the result set.