Can't reinstall macOS on iMac
use Command+R For Internet Recovery To the version you were using and Command + Shift + R for internet recovery (to The latest version). When you will go to internet recovery a disk utility option will be there and u can configure , format your hdd there and install new os