We develop a tractable general equilibrium framework of housing and mortgage markets with aggregate and idiosyncratic risks, costly liquidity and strategic defaults, empirically relevant informational asymmetries, and endogenous mortgage design. We show that adverse selection plays an important role in shaping the form of an equilibrium contract. If borrowers' homeownership values are known, the equilibrium state-contingent contract depends on both aggregate wages and house prices. However, when lenders cannot observe borrowers' homeownership values, the equilibrium contract only depends on house prices and takes the form of a home equity insurance mortgage (HEIM) that eliminates the strategic default option and insures the borrower's equity position. Interestingly, we show that widespread adoption of such loans has ambiguous effects on the homeownership rate and household welfare. In economies in which recessions are expected to be severe, the HEIM equilibrium Pareto dominates the equilibrium with fixed-rate mortgages. However, if economic downturns are not severe, HEIMs can lower the homeownership rate and make some marginal home buyers worse-off. We also note that adjustable-rate mortgages may share some benefits with HEIMs. Finally, we find that unrestricted competition in contract design among lenders may lead to a non-existence of equilibrium. This suggests that government-sponsored enterprises may stabilize mortgage markets by subsidizing certain lending contracts.