Two things I look for when replacing a phone:
1. Lineage OS support. (So you actually get security updates)
2. A decent repairability score on iFixit. (So you don't end up with a brick when your battery dies in a few years.)
Right now I'm on a OnePlus 2. It will be 4 years old this summer and doesn't seem to have any issues with the newest Android (in the form of Lineage OS), or any apps I use!