The Jebusites lived in Jerusalem, and the people of the Judah tribe could not capture the city and get rid of them. That's why Jebusites still live in Jerusalem along with the people of Judah.
Ephraim could not force the Canaanites out of Gezer, so there are still some Canaanites who live there among the Israelites. But now these Canaanites have to work as slaves for the Israelites.
The Jebusites were living in Jerusalem, and the Benjamin tribe did not defeat them or capture the town. That's why Jebusites still live in Jerusalem along with the people of Benjamin.
and you promised not to make any peace treaties with the other nations that live in the land. Besides that, you agreed to tear down the altars where they sacrifice to their idols. But you didn't keep your promise.
“Go and attack the Amalekites! Destroy them and all their possessions. Don't have any pity. Kill their men, women, children, and even their babies. Slaughter their cattle, sheep, camels, and donkeys.”