Montgomery County Maryland
Hi- no closer than 6 ft.; 8-10 ft. would be better especially if it grows well and you allow multiple stems to grow. The wall of your house will help to protect the plant over winter, especially if its south-facing. The issue is being able to get behind it to prune and harvest. The roots won't damage your foundation and you can cut through them if you felt there was a problem.
See our web page and videos on fig: https://extension.umd.edu/hgic/topics/figs