It is so called impersonal sentence (безличное предложение). In your case the main member of the sentence is expressed with a negative form of the predicate (не было) in combination with a noun in the genitive (мужа). Here the emphasis is on the absence of the husband (There was no husband at home), while "муж не был дома" tells us about non-attendance of the husband (The husband was not at home). Verbs in impersonal sentences come in the form of neuter gender, singular.
Personal affirmative sentences, nominative case:
- Я дома - I am home
- Я был дома - I was home
- Я буду дома - I will be home
Impersonal negative sentences, genitive case:
- Меня нет дома - I am not home, there is not me in the house, the house is "empty"
- Меня не было дома - I was not home, there was not me...
- Меня не будет дома - I will not be home, there will not be me...
Personal negative sentences, nominative case:
- Я не дома - I am not home, I am in some other place
- Я не был дома - I was not home, I didn't visit it (as a fact of visiting)
- Я не буду дома - I will not be home, I will not visit it (as a fact of visiting)