Programmed software obsolescence is the acceleration of the aging of a device by updating its operating system. It’s ugly, and damn pernicious. So if you want to breathe new life into a fully refurbished iPhone, up to 70% cheaper, it’s this way.
So to help you see more clearly, here is a list of supported iOS for each version of iPhone:
To directly answer a recurring question: the iPhone 7 and iPhone 8 are compatible with iOS 14.
What if your device can no longer be updated, you can find alternatives to iOS here.