Hi Laurenska,
I'm not a regular poster on QP.com, so I'm afraid I don't know anything about your background. How long have you had the little green hooligan? Is he an only bird or do you have others?
If he has formed a bond with you, then it sounds as though he's suffering from separation anxiety – when you leave, he feels abandoned and unsure wthere or not you'll ever come back.
Shouting and squirting won't help, as you've already realised. What you uhave to do is help him to realise that you will always be coming back.
If he's happy when you're in the room with him, then put him in his cage and get him comfortable. Talk to him all the time. Then, keep talking, but leave the room. Stand outside the door, talking all the time so that he can still hear you, and after just two minutes, go back into the room.
Praise him and give him a treat – especially if he didn't make too much noise while you were out of the room.
Then repeat the process, but this time, stay outside for three minutes before coming back in and making a fuss of him. You get the picture... You gradually extend the periods that you are out of the room until he's happy that, even though you're not there, you will always come back to him!
It's not a quick fix, unfortunately, but correcting bad behaviour in our feathery friends seldom is.
Hope that helps!