Kubfu is a Legendary Pokémon because (a) The Pokémon Company said so, and (b) the Pokédex registers Kubfu after Eternatus. According to multiple sources, there is no definite way of determining which Pokémon is a Legendary Pokémon except for when official sources say so. In this case, Kubfu and Urshifu are mascots for the Isle of Armor Expansion Pass, and the developers gave them elite treatment.