The decision to drop Flynn's case was politically-motivated. He was an unregistered foreign agent who lied to the FBI.
As for Trump: Sitting presidents can't be indicted per OLC guidance. There's solid logic for that but Trump is straining the limits of that.
We'll see what happens when he leaves office, or if Trump tries to pardon himself as he's claimed he has the right to do.
His game plan is likely to pardon all the Russiagate cronies that the DOJ doesn't let off for him. Constitutional, but scummy, so he's holding off for now and wants the DOJ to cover their asses.