For example, he registered the license key to his Battlenet account. My question is, can i use his code in order to activate my Diablo 3?
Sharing your account is not against ToS.
*****Never give out your account information.
Sharing your account information with a family member, friend, or another player is an easy way to lose control of who has access to your account and increase the risk of compromise -- no matter how well you might know the person you’re sharing your login information with. Keep in mind that even if you practice optimum Internet security at home, you can't control how another person will make use of your account information…or how secure their own computer system might be.*****
There is nothing about bans or whatever.