Who is the ruler and the he and the him in that passage?
I have answered twice already, but I will try again. And I will use your NIV translation, even though it has problems.
Keep in mind that Christ is the MAIN topic of this whole passage. It is about HIS coming, that timing, and HIS work.
Daniel 9:25 Know and understand this: From the time the word goes out to restore and rebuild Jerusalem until the Anointed One[CHRIST], the ruler, comes, there will be seven sevens, and sixty-two sevens. It will be rebuilt with streets and a trench, but in times of trouble. 26 After the sixty-two sevens, the Anointed One[Christ] will be put to death and will have nothing.
[begin parenthetical statement about what would follow after Christ’s death regarding Daniel’s people of whom Daniel was praying]
The people of the ruler[Titus] who will come will destroy the city[Jerusalem] and the sanctuary. The end will come like a flood: War will continue until the end, and desolations have been decreed. [end parenthetical statement]
27 He[Christ] will confirm a covenant[New Testament] with many for one seven. In the middle of the seven[after 3.5 years of ministry] he[Christ] will put an end to sacrifice and offering[Christ became our sacrifice].
[here is where the NIV translators made things less clear than most literal translations , there are no “he” to carry through as the NIV shows]And at the temple he will set up an abomination that causes desolation, until the end that is decreed is poured out on him.
Here is the ESV “ And on the wing of abominations shall come one who makes desolate, until the decreed end is poured out on the desolator”
While this whole passage primary fulfillment is talking about the Messiah’s advent and the destruction of Jerusalem, there is also some mirror prophecy stuff going on related to Jerusalem and the Muslims (Caliph Omar). I don’t have the time or inclination to go that deep here.