"Can I do this more than once, or just once in my lifetime?"
You can do this every two years. The old once in a lifetime exclusion went away sometime around 1997.
So let’s say that you and Muffie sell your Beacon Hill condo (principal residence) that you bought five years ago for $600,000 for a cool $1,000,000. That gain of $400,000 is excluded from tax (federal and most states – Massachusetts for sure). You then relocate to your home on Cape Cod that you bought ten years ago for $250,000. Three years from now you decide to retire to Florida and you sell the Cape Cod home for a sweet $700,000. That gain of $450,000 is also free of tax. And, yes, you are correct, you may well do this two years later with the Florida home.
The home has to be your principal residence for two of the preceding five years.