Valency is the  number of free electrons in the valence shell
Valency of nitrogen is three which means that it has 3 electrons free in its last shell for it to react. Same is for boron
3 5 3
Valency is the no of electrons that an atom can gain or lose during a chemical reaction.......
nitrogen has 5 (more than 4)electrons in its outer most shell or orbit
so it is deficit of 3 electrons which it can accept from other element during chemical reaction. when an atom accept electrons it gets negatively charged so the valency of nitrogen is -3 as
but boron has 3 electrons (less than 4 ) so it will readily lose electrons and become positively charge
and the valency will be +3
3 4 3