ESP32 touch pin to control relay

Have you read this tutorial: Using millis() for timing. A beginners guide ?
From the code you posted I suspect not, it will help you use millis() for timing.