Even Bill Maher is asking, “If Trump and Putin were so close, then why didn’t Putin attack Ukraine when Trump was president?”
Right or wrong, better or worse, I think that Putin expected Trump to be reelected in 2020. Europe and NATO have proven to be more united and more opposed to the invasion than Putin anticipated. Given Trump's opposition to NATO, his acrimonious relationship with most European leaders, his poor relationship with the Ukraine, and his good relationship with Putin himself I think Putin thought his chances of success would be better under a second Trump administration. Again, it may well be a major miscalculation on Putin's part but I believe that was behind his decision.