Object rotation then why object position changes

I have mentioned my code in this. Can you help find the which changes i should changes. because i can’t understand any in computer graphics theory