Chosen Solution

I bought a second-hand iPhone 7 in great condition and I found out the home button doesn’t work (touch id and button function)I’m not sure if the button has been replaced or not. If so is there anything I can do??

The most common cause for home button failures on the 7 series is a micro tear in the flex coming from the screen to the logic board. You will need to get a replacement screen.  If it is still not working you will need to purchase a “universal home button” it will bring back everything but fingerprint ID.