Which partition do I need to format or fix in order to install Sierra or lion?
When restarting your Mac, you may hold Command (⌘)-R to enter your local recovery partition. From there, you should be able to erase and format your internal storage drive (e.g. Macintosh HD) using Disk Utility.
Please note that erasing your drive will result in data loss.
For macOS Sierra or OS X Mountain Lion, you should erase your drive using a GUID Partition Map and Mac OS Extended (Journaled). For complete steps to erase and format your drive, please refer to How to erase your Intel-based Mac. After erasing your drive, you should proceed with reinstalling macOS.
If you've completed the above steps but the same issue occurs, then there may be something wrong with your local recovery partition. You'll want to try the following next steps to access internet recovery (this requires an internet connection):

On an Intel-based Mac, you can use Option-Command-R at startup to upgrade to the latest macOS that is compatible with your Mac, with some exceptions.

On an Intel-based Mac that previously used macOS Sierra 10.12.4 or later, you can use Shift-Option-Command-R at startup to install the macOS that came with your Mac, or the closest version still available.


If the above still fails to resolve the issue, you may try creating a bootable installer for macOS using another Mac if necessary.
If any issues persist after completing all of the above steps, you may be experiencing a hardware issue. I'd recommend contacting Apple support for further assistance.