I suppose you are using Raspbian. With my RasPis I have found that they tend to connect first to the 2.4 GHz band if both bands available. So first you should check if the 5 GHz band is seen by your RasPi. Execute this command.
rpi ~$ sudo iw wlan0 scan | grep -A5 'freq: 5'
It should give you at least one (ore more) outputs like this:
beacon interval: 100 TUs
capability: ESS Privacy SpectrumMgmt ShortSlotTime RadioMeasure (0x1511)
signal: -71.00 dBm
last seen: 0 ms ago
If you find one then you can restrict wpa_supplicant only to connect with this frequency. Just add a line
/etc/wpa_supplicant/wpa_supplicant.conf. According to the documentation in
/usr/share/doc/wpa_supplicant/examples/wpa_supplicant.conf you can set it general or within a network block:
# freq_list: Array of allowed frequencies
# Space-separated list of frequencies in MHz to allow for selecting the BSS. If
# set, scan results that do not match any of the specified frequencies are not
# considered when selecting a BSS.
# This can also be set on the outside of the network block. In this case,
# it limits the frequencies that will be scanned.
This is an example for a general setting (use your settings for country, ssid and psk). You may consider to move the
freq_list inside the network block:
# freq_list=2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472
# freq_list=5170 5180 5190 5200 5210 5220 5230 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700
I have commented a complete list of frequencies so you can select what frequencies you want to connect to.