Upgrade iMac12,2 from Mac OS X 10.6.8
On Apple's How to Upgrade page it states 


  Upgrading from OS X Snow Leopard or Lion. If you're running Snow Leopard (10.6.8) or Lion (10.7) and your Mac supports macOS High Sierra, you will need to upgrade to El Capitan first.


You will have to first upgrade to El Capitan, then to High Sierra. You can follow these instructions to get El Capitan.