How is the inventory of a spouse's shop determined?

If your spouse was a merchant before you married them, they will sell the same goods they would normally. If not, they will sell pawnbroker-type goods and (reportedly) loose items you leave in their inventory. They will not sell items you leave around the house.

Their inventory "refreshes" like other shopkeeper inventories, so don't sell them something you are planning to buy back later.