A3B2
bond is ionic
A is in group 2 (you can pick any like Ca)
B is in group 5 (like B)
the other question:
the reason is they are neutral gas and they already have 8 electrons except for He which is 2 and are completely stable so don't want to loose any electron vs Li and Na which have only 1 electron in the outer layer and are willing to loose that one to become stable.