It would help to know at what step you are having a problem with performing a clean install of macOS. And it would help to know what error messages are presented.
Also how are you booting the macOS installer? Internet Recovery Mode (which keys were used) or from a bootable macOS USB installer?
It would also help to have the exact model of the Mac. You can get the exact model by entering your serial number here:
Check Your Service and Support Coverage - Apple Support
Edit: And how are you erasing the drive? On an Intel Mac it is best to erase the whole physical drive. It may be necessary to click "View" within Disk Utility and select "Show All Devices" so that the physical drive appears on the left pane of Disk Utility. Depending on the OS being installed you may need to erase the drive as GUID partition and MacOS Extended (Journaled), or as GUID partition and APFS (top option)....use the latter if it is available. If you are installing macOS 10.10 or earlier, or if you have an M1 Mac, then things are a bit different.
What version of macOS are you attempting to install?