I don't understand

I've been a lot more active the past few weeks and eating less and I've gained six pounds (I'm trying to lose weight) everytime I've ever done this I gain weight but when I don't try being more active and eat anything I want I lose weight. I just don't get it, isn't it supposed to be the other way around?😂😭