Then all Israel assembled before David at Hebron. "Look at us," they said. "We're your very flesh and blood.
In the past, yes, even while Saul was king, you were the real leader of Israel. God told you, 'You will shepherd my people Israel; you are to be the ruler of my people Israel.'"
When all the elders of Israel came to the king at Hebron, David made a covenant with them in the presence of God at Hebron. Then they anointed David king over Israel exactly as God had commanded through Samuel.
David and all Israel went to Jerusalem (it was the old Jebus, where the Jebusites lived).