I would say the late 2014 27” iMac is the best bang for the buck. It has the 5K retina screen and was the first iMac to offer Thunderbolt 2. Obviously an SSD would be ideal, but they’re hard to find in the wild. Instead look for at least a 1 TB fusion drive. The 2014 iMac still included a 128GB SSD with the Fusion drive. As far as ram, since it’s easily upgradable in the 27” iMac I wouldn’t worry about a machine with only 8GB.
For basic use the 2010 21.5" models are hard to beat in terms of value. Sure they only have a couple years of life left, but they also have a cheap market value and the 2011 and older 21.5" models share the same user upgradable ram as the 27".
Speaking of which, if want a quad-core i5 and are ok with older bluetooth/USB standards then a 21.5" 2011 is a value year.
On the other hand if you want full-features you are probably looking at a 2013 27" (missing only Retina and TB3/USB-C), and if you want GPU performance value or longevity you probably want to find a refurb/used 2017.