If I buy a iPhone with a broken screen and I repair the screen will it turn on still locked and be unusable?

I'm thinking about buying broken iPhones and repairing their screens to resell them but how do I know if I buy a phone that won't turn on that once I fix the screen and it does turn on that it won't be locked from the previous owner and be unusable? Can they then be completely reset to be able to be re sold?

That's the problem. If you can see the phone powered on, there's no guarantee that it actually works. That is unless the seller guarantees that it does work, with just a broken screen.

You're taking a big risk by doing this.

The PIN lock can be removed by reflashing the phone; that's more privacy, you can't get to the users info without the PIN.

The so-called "icloud lock" is a totally different thing. That links the phone and a user login together on Apple's servers and _cannot_ by bypassed - the only way to get through the activation sequence is to have the correct username and password.

It's the most basic anti-theft system; a stolen phone can never be erased/reactivated so is virtually worthless.

Also remember that with the ones that have a fingerprint reader, the "home button" itself is cryptographically linked to the main board and changing either disables the fingerprint system.
They must be kept as a pair and if the button is damaged the fingerprint system can't be used again.