I posted a thread a few weeks back about a leaky head on my Eheim 2026 and in my case I was able to finally figure out what was wrong.
Some things to possibly look out for:
1) In my case I must have banged one of the head corners on the floor when I took it apart as I finally discovered it was slightly puffed up there when I ran my finger tips over it.
Even though the large head gasket looked fine apparently this puffed up corner edge kept the head from fitting flush. I sanded it down on that exact spot until it was very smooth and the head did not leak anymore.
I also thought my pump head gasket might be leaking before I figured out the real problem as it looked like water was coming out where the electrical cord goes in. I ordered a new pump head gasket from AtomicRice as well and it did not solve my leakage problem.
I did notice that the original Ehiem head lubricant on the pump head gasket was dried and caked and the button was not priming well. I relubed it with new Silicone lubricant when replacing the pump head gasket and now it just glides up and down.
This is the lubricant I use on all hose connection and gaskets:
Lifegard Pentair Aquatics Silicone Lubricant
2) Another thing to look for is any cracks in the clear plastic flow rate hose connection when you have the pump head apart. This is the piece that the the dual hose connection fits inside. Sometimes this can get a crack in it which then leaks water into the pump head. There is a single gasket at the bottom of it as well which can be relubed. Make sure the dual hose connection is aligned correctly before before pushing the flow regulator lever forward and making the final connection so you do not crack this piece in the pump head.
3) One other place where a leak can form is a small hairline crack in the dual hose connection. If you see water or feel water dripping from the dual hose connection then there is probably a small crack in it. These cracks can happen when one of the hoses does not enter the dual hose connection straight on. If there is a contant sideways pressure on the dual hose connection or you yank on one of the attached hoses it can cause the dual hose connection to break or crack and leak.
As far as it only leaking when it was turned off I noticed something similar on another one of my Eheim canisters. It was running fine when wide open but it would leak at the head when I throttled the flow back. I finally noticed that one of the head clamps was not closed all the way. It was on one of the newer Ehiems with the side head clamps instead of the corner head clamps. One side was latched flat but it was not hooked onto the head.
My point being that when the filter is running there seems to be little inside head pressure to force water out of the side of the head as the water is going straight through . When you throttle flow back it seems to create more internal head pressure and then water will try harder to fiind a way out.
Your case might be similar in that when it was running the pressure kept the water moving in one direction and when you unplugged it the water will try to flow backward into the head on both hoses instead of only one (input). This might help isolate where your leak is.