First of, the international consensus is that all settlements are
illegal. The last resolution about them, SC
2334 (adopted 14-0)
the establishment by Israel of settlements in the Palestinian
territory ... has no legal validity and constitutes a flagrant
violation under international law
This means that it only makes sense to analyse the "legality" aspect
from the Israeli perspective.
The West Bank is administered by an Israeli governing body called the
Israeli Civil Administration (CA). After the Oslo agreement, the West
Bank was split into three zones; A, B and C and administration of it
shared with the Palestinian Authority.
Note first that the Oslo split didn't change the law. It changed who
has jurisdiction to carry out the law, but not what the law is.
Note also that administration by the CA does not imply Israeli
being imposed. It is a different situation from East Jerusalem which Israel
has annexed, meaning that Israeli law holds and all construction there
is legal as long as the proper permits have been acquired.
This means that your second question "how many settlements are legal
on the Israeli law?" has no answer in Israeli law because it isn't
Instead, the law is what the CA and the Israeli military (IDF) which
controls most of the West Bank says it is. Their view, which is
congruent with the Israeli state's view, is that the West Bank is
under belligerent occupation and that the Geneva Conventions
applies. It is important to them because it enables them to implement
restrictions for security purposes that would be hard if domestic
Israeli law had been applied. Settlers living in the West Bank has
fewer rights than Israeli citizens in Israel.
All construction in Area C of the West Bank is illegal unless
necessary permits have been acquired from the CA. Illegal structures
run the risk of being demolished. A common complaint among
Palestinians is that these rules are unevenly enforced -- that their
illegal structures are often demolished while the CA turns a blind eye
towards settler buildings.
This means that a lot of settler construction resides in an ambiguous
state. De jure illegal, but de facto legal. Many settlements start
of as being illegal but after a decade or so they are retroactively
given builing permits and therefore legalized.
Your first question is simpler to answer. See this
map of settlements by Peace
Now. As you can see there are no settlements in Area A or B.