A bit of both. He definitely did criminal things, but they look worse because Gaddafi was such a politically unpopular ("terrorist") leader in the west. If he'd got the same funding from the Obama regime, surely he would never have gone to prison.
I mean, I don't think we need to put air quotes around "terrorist" for Gaddafi. This was a ruler who was happy to bring down Western passenger jets and put bombs in night clubs.