Sorry for writing in English.
It isn’t possible to order the wifi networks on iOS. They’re stored in the keychain and the order an be set in Network Preferences / Advanced / Preferred Networks on a Mac. However, this only affects the order when more than one SSID is visible when wifi is turned on.
As you walk into your apartment block, your phone will see a neighbour’s Wi-Free network before it sees the one inside your own apartment. Once it connects to Wi-Free it won’t disconnect unless it loses that signal. If Wi-Free can be reached from inside your apartment then it will stay connected to it.. The solution, unfortunately, is to “forget” the Wi-Free network on my phone and not use it. The alternative is to manually select my home wifi network each time I return from being out.