So fire them. Everyone is hired to do a function. If someone can do that function with a minimal amount of time, why should they waste their extra time on performative work? Give them more to do, or accept they don’t need the amount of time in the standard work week to complete what you hired then to do.
If they are goofing off at home and not completing their function, fire them.
If you can’t even tell if the function is being done or not then the functions that aren’t being performed are those of management. But ensuring everyone comes to the office doesn’t solve that problem.