Revenue from a doubling of council tax on second homes in North Yorkshire is set to be used to build more than 500 affordable homes.