Is it right to say: I'm leaving for home now.
I mean I am at my job talking to someone, so I'm about to go home.
I've seen on my studies that people being at home say I'm leaving for the library.
Yes, that's correct. In this context, 'I'm leaving' actually means 'I will leave', so you could also say, 'I'm leaving for home in about 20 minutes, so...'