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, aggregate wages and house prices determine the optimal state-contingent mortgage payments, which efficiently reduces the costs of liquidity default. However, when lenders are uncertain about 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 (ARMs) may share some benefits with HEIMs, which may help justify a high concentration of ARMs among riskier borrowers. Finally, we find that unrestricted competition between lenders may lead to a non-existence of equilibrium. This suggests that government-sponsored enterprises may stabilize mortgage markets by subsidizing certain mortgage contracts.