The Scottish Government has set ambitious plans to build 100,000 affordable new homes by 2040.