>

His expenses are pretty suspicious too.
It actually shows he received a five million dollar refund in 2020. >

Which is nothing compared to the $72 million refund he got in 2010
Trump’s Seventy-Three-Million-Dollar Tax Refund Is the Biggest Outrage of All

From 2005 to 2007, this latest Times scoop reveals, he did finally pay about seventy million dollars to the Internal Revenue Service. But then, in 2010, he demanded a full refund for those tax payments. And the I.R.S. acceded to his request: it paid him $72.9 million, including interest. This 2010 refund seems to be at the center of an auditing dispute between Trump and the tax authorities that has dragged on for almost a decade. It also appears to be the money that Michael Cohen, Trump’s former personal lawyer, was referring to in his 2019 testimony to Congress, when he recalled Trump showing him a huge check from the U.S. Treasury and remarked that Trump “could not believe how stupid the government was for giving someone like him that much money back.” >

Might be a dumb question, but was any of this legal?  Like did he just exploit some bullshit loopholes, or was it full on fraud? >

Trump reported that his businesses incurred major losses hence the refund. It's those losses he reported that is in question.