Whether it's illegal is not really so black or white. In relation to international law, it is not illegal for israelis to reside in judea and samaria. Palestine is not a recognized country with defined borders. It may sound strange, but as long as people move into the area on their own accord - then it's quite legal to move in and build. What so many people and media are saying about the alledged illegality stems from a misunderstanding about what international law actually says.
UN agency warns school may be delayed for Palestinian refugees due to lack of funding (AP)
from the article: The Amona complex