Are you on well water? Sometimes well water will react with the cathodic protection rod in your hot water tank and cause bacteria to grow which will produce a sulpher gas smell, i e rotten eggs.
I have seen cathodic protection rods that were made for well water but

not recently. Mine was bad enough I took the drastic action of removing the CP rod, of course at the risk of shortening the tank life.