More than three million medium-density homes can be built nationally, a new analysis shows – but there are hurdles.