Here are the results of two google searches of "Price for 2012 21.5" iMac i5 2.7 ghz:
https://www.google.com/search?q=Privce+for+2012+21.5"+display+i5+2.7+ghz&rlz=1C5CHFA_enUS628US629&oq=Privce+for+2012+21.5"+display+i5+2.7+ghz&aqs=chrome..69i57.3686j0j1&sourceid=chrome&ie=UTF-8
https://www.google.com/search?q=2012+21.5"+iMac+i5+2.7+ghz&rlz=1C5CHFA_enUS628US629&oq=2012+21.5"+iMac+i5+2.7+ghz&aqs=chrome..69i57.8388j0j1&sourceid=chrome&ie=UTF-8
$300 seems like a real good price. Also, that iMac can run Apple's latest OS, High Sierra, OS 10.13.6.
As far as checking things out, when the machine boots up, if it asks for a password, that means their old password is still "active". If it boots up and starts asking for setup information, then there should be no old passwords on the machine. That also means there is an OS on the machine. It would be best if you find out what that is.
Did the ad say how much memory it has? Also, does it still have the original internal disk drive that came with the machine?
If this is the machine:
https://everymac.com/systems/apple/imac/specs/imac-core-i5-2.7-21-inch-aluminum-late-2012-specs.html
then it has 8 gig of Ram (that's good), and a 1 TB 5400 RPM internal drive (somewhat slow, but it gets the job done).
Finally, is the seller including any third party (ie, non-Apple) software?
If there is an OS on the machine, and you want to check out the internal drive, when the machine starts up, hold down the Command Key (should be to the left (and right) of the space bar) and R key at the same time. This will boot to the (hidden) Recovery HD partition, described here:
https://support.apple.com/en-us/HT201314
Select Disk Utility from the screen/menu that appears, and then select the internal drive, and select First Aid. That will verify (and if needed, repair) the internal drive. It will also tell you if there are any issues with the drive.