This is not true. The DMCA’s “safe harbor” provisions do not provide any sort of bulwark against criminal prosecution. Only against civil liability and injunctive relief.
If you follow the DMCA (e.g., honor takedown notices, register an agent if you’re a platform, and act quickly when notified), your exposure to criminal liability is essentially zero.