I know that formatting the SD card will not lock my phone again.
But if I Factory Reset my phone, will it re-lock the phone or not?
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
It is still kind of unclear what you exactly mean.
In general: a factory resets formats the whole userdata(data) partition. The data partitions contains your installed apps, databases where your customized settings for the android system are stored(for example if you changed your homescreen; added some shortcuts/widgets etc.). Also the cache of the virtual machine resides on this partition....as the name already says it's mainly used for userdata.
If you are talking about a rooted phone(windows term: administrator): a factory reset usually does never remove your root access. Normally rooting procedures install a "su" binary in /system/xbin/su or /system/bin/su, this is obviously stored on the system partition which is never touched by a factory reset.
As already mentioned the bootloader is shipped unlocked and won't be locked again.
Samsung Galaxy S2 is shipped with an unlocked bootloader, so it won't be locked when you Factory Reset it. If it's rooted, it will not be unrooted, but SuperSU or Superuser app itself may be removed (If it's not installed in system partition), so you'll just have to reinstall it. And if it's a factory unlocked carrier specific version of the phone like i777 (AT&T), then it may get carrier/network locked again (Booting up the first time after a factory reset it may ask you to enter the Network Unlock Code if you use a non-AT&T SIM), although in most cases this won't happen.