Been there, done that. We had a really stinky boat. Adding to what RichH recommends is to check the head if saltwater is used. Critters from seawater die inside the rim of the toilet and smell bad. Pull the intake hose and pour vinegar into it to rinse. Also, check to make sure that the head hoses themselves have not permeated. Lots of suggestions for how to test and eliminate here on the site.
I always dry the bilge area with a sponge before leaving, so no standing water is left to go septic.
Lastly, ventilation works very well. Just leaving a couple of hatches cracked open and getting air to flow freely caused the smells to go away. Leave lockers open when away. I have a couple of solar power computer fans in the dorades that move air. Also resulted in tremendous improvement.