Since the H1 and H4 belongs to the same catergory, both of them counted toward the 6 yr total.
Say, you have been H1 for 3 years, and your spouse was F1 then. Now he is H1 for 3 yrs, and you can be H4 for another 3 yrs with no problem. But if he renew his H1 for another 3 yrs, that is 6 yrs for him. Now you cannot get another 3 yrs of H4, since you already have H visa (H1+H4) for 6 yrs by his extension.