You'll have to figure out why your devices preferentially connect to the free wifi. It could be that the signal is stronger, or there is interference or congestion on the channel that your router is using. Or maybe there is something wrong with your router setup. Hard to say from here.
First, read one or two of the articles to get an understanding of the various channels available on the 2.4GHz and 5GHz bands. Make sure that you know how to set up your router - usually you have to use a web browser and type in the IP address 192.168.0.1 or 192.168.1.1, something like that, so take you to the router setup page.
Then use the Mac's built-in wifi diagnostics to look at the available networks ---> Hold down the <option> key and click on the wifi symbol (one of the symbols or icons at the very top of your screen, near the right side. It looks like a fan with curved lines, coming to a point at the bottom.). You will see a drop-down of the available networks with the channel number and signal strength (RSSI number, the smaller the absolute value of the number, the better) of each network. For the networks that you are not connected to, just "hover" the cursor over the network to see that network's information. You can disconnect from the apartment's free network and join the one that you choose.
Now that you can see the available networks, you might get an idea of what the problem is. If you see a bunch of networks all broadcasting on channel 6 (or 1 or 11), for example, you should avoid that channel. You can then go and set up your router to broadcast on a vacant channel (or the least crowded channel). For the 2.4 GHz band, technical issues indicate that you should use band 1, 6 or 11 (read the articles). There are more choices, or you can just use automatic setup, for the 5 GHz band. In your router setup, choose a name for your network (so-called SSID) that you will recognize (You can use "adejesus' network", for example). Then set up wifi in your devices to connect to that network and to avoid the apartment's free wifi.
Depending on your situation and how congested your wi-fi network environment is, it might be worthwhile to buy a dual-band router that has both 2.4 and 5 GHz bands. (This assumes that your devices are capable of using the 5GHz band, of course). The 5GHz band is usually less crowded because the standard is newer and most people don't know enough or don't bother to move to the 5GHz band.