TT #37 · Parashas Va’eschanan · Passuk 6:9
And you shall write them on the doorposts of your house and on your gates.
Torah Temimah points to Yoma 11b (which structures require a mezuzah — “beisecha” implies a dwelling used for honor / residence).
English: It was taught: “Your house” — your house that is designated for you, excluding a hay-barn, a cattle-barn, a wood-shed and a storehouse, which are exempt from mezuzah. One might have thought even a gateway, a portico and a balcony? The verse says “house” — just as a house is designated for dwelling, so everything designated for dwelling.
Diyuk of “beisecha” — designated dwelling, excluding non-residential structures.
Mezuzah is required only on doorways of structures used for ordinary residential dwelling; barns, storehouses, gateways and the like are exempt.