It has always been very simple.
When playing against the entire division, then it is always a. Home-Away-Home pattern....2017 - Chiefs at Home, 2020 - Bills at Home and 2023 - Chiefs at home. In the non-division year, the same finish positions play each other but at the same location for the two years and then they will rotate again. So Chiefs got to host the Bills in 2021 and 2022 as the AFC West is home to AFC East. In 2024 and 2025, we will host whoever we are playing against in AFC West.