How often do you wash your hair?

I used to have terrible dandruff and oily hair. I was washing daily and I use pretty clean brands. I since have switched to washing every 3 or 4 days and my hair is healthier and I don’t have dandruff anymore. Obviously, if I’m doing yard work or sweating I’ll wash my hair, but I usually keep this cycle and I’ll condition my hair one day in between.

The reason I am asking is that I noticed some people are saying to wash your hair even more than once a day. I feel like that will ruin your hair. Have I been thinking wrong this whole time?