While he never openly established regime change as HIS goal (while it has been the IDF's all along), he has realized too late that regime change is necessary to accomplish his goals, and that the Iranian people cannot overcome the power and influence of the God Mafia (IRGC), so regime change appears not to be a real possibility.
In a sane war, you beat the shit out of your opponent until he cannot take it any more and "sues for peace." But in a crazy war with Muslim zealotry on the other side, death is viewed as a good thing, so you never reach the point where they can't take it any more.
Result: quagmire.
The only solution is to declare victory and withdraw, leaving yourself not visibly better off than you were at the start. Maybe you are better off with Iran weakened and de-nuclearized, but it might not be visible to the casual observer. And China will do everything it can to put Iran back in the nuclear game.
The fact remains that Trump has the ability to go through with his threats and put Iran back in the figurative "Stone Age." He can destroy their infrastructure and make it nearly impossible to sell Iranian oil, but what will that accomplish other than making the Iranian people truly hate us, rather than just parroting hateful slogans?
It's difficult to see any result(s) that will justify the whole adventure.