What you generally want, in selecting tires, is the size for which the outer diameter is approximately the same as stock. You don't want them to be too much larger or wider, or they could rub. You don't want them to be too much smaller, either. The closer they match, the less error you will be adding to your speedometer and odometer.
You can use a tire size calculator (like this one
) to compare each of these sizes to your stock 205/50-16 size. Here's how the outer diameters compare:
205/50-16 0.0 percent (stock)
205/40-17 -2.6 percent
205/45-17 +0.8 percent
215/40-17 -1.2 percent
215/45-17 +2.3 percent
Now you can see why 215/45-17 might rub; it's a lot bigger in diameter AND it's wider than stock. Why don't those other sizes rub? The 205/45-17 is only slightly larger in diameter and it's the same width as stock. The 215/40-17 is wider, but it's smaller in diameter than stock.
You can also see why 205/45-17 and 215/40-17 are better than the other sizes: because their outer diameters are much closer to your stock size.
Either 205/45-17 or 215/40-17 will work just fine on your car.