H4 dependent visa’s status is tied to H1B’s status.
Always remember that if primary H1B goes out-of-status, H4 also automatically goes out-of-status.
H1B status cannot be maintained if leaving for 6 months
If your spouse goes to UK for work after LEAVING his H1B job, he is effectively abandoning his H1B status and hence, your H4 status too.
If he does not leave his H1B status i.e. the H1B job is still ON and he keeps getting paid for it and his payroll is ON while he is on temporary work in UK, he is all good with the legal status.
Hence, your H4 status is also maintained.
If he abandons his H1B status for those 3 months, all his H4 dependents should also leave the country with him to avoid accumulating out-of-status time in US.
He and his dependents can off-course come back to US after the project in UK and re-start work on H1B, if the visa is still valid.