The second box/whisker plot is correct.
First we have to put he data set in ascending order:
16, 17, 18, 20, 21, 22, 23, 25
The median (middle number or average of 2 middle numbers) = 20.5 The center line of the box needs to be at 20.5
The middle of the first half of the data is 17.5, (average of 17 & 18) so the left side of the box needs to be at 17.5
The middle of the second half of the data is 22.5, (average of 22 & 23), so the right side of the box needs to be at 22.5.
The “whiskers” are your bottom & top numbers...representing the full range of data. They should be at 16 & 25.