Questions about nursing, just to preprare

My husband and I have been talking about having another baby once we’re back on our feet, financially. One thing that has me hesitant is that I don’t want to gain all the weight back. I’m one of those women who gains weight while nursing, so even though a lot of the pregnancy weight comes off right away, I have gained it all back with both kids during the time I was nursing. How do you maintain a healthy weight while pregnant and mostly, while nursing, so that you don’t gain all the weight back that you lost while fasting?