Apple has been supporting their iPhones iOS wise 4-5 years after launch, most of the recent phones have gotten 4 iOS versions (not including launch iOS version).iPhone 8 was launched 2017 with iOS 11 and so will get iOS 15 (and maybe iOS 16 at most). Of course you can keep using the 8 until it breaks, but software updates ends most likely 2022.