Let me put it simply.
If Bangladesh wins all 3 matches and SA wins 2 of the 3, both BD and SA will have 8pts.
ENG and WI can have the at most 6 pts if they lose to BD.
So for the 4th spot it will be SA vs BD ( both with 8 pts ). Since head to head BD beat SA, BD will go thru. (RR calculation comes into play when 3 or more teams with the same pts are involved).