Humidity sensor controlling pump for x seconds

The program logic needs to be revised completely. You update previousmillis immediately after making the test.

You need separate variables that remember the time at which the pump was turned on and when the measurement was made. Study the "how to do several things at once" example posted elsewhere on the forum.

In timing statements, you should always use unsigned long constants to avoid confusion (e.g. 6000UL).