Despite being set over 300 to win in the fourth innings following a declaration by England captain Joe Root, the West Indies won by five wickets .