Why makes earth to rotate on its axis
The shortest answer is angular momentum. Angular momentum is simply the name we give for the fact that things tend to rotate. (Just like regular momentum is the tendency for things to move.) The Earth formed out of a nebula that collapsed. As the nebula collapsed it began rotating, which may seem odd, but actually not rotating is far stranger than rotating. The Earth's rotation comes from the initial tendency to rotate that was imparted on it when it formed, only the relatively weak tidal forces from the Moon act to slow it down.
U can also say that gravitational forces are also responsible for its rotation and u can say even in the atoms electrons are also revolving to counteract or to balance the forces or angular momentum .
Also due to the spooning the iron ball in the earth core which results in the rotation. Of earth as moon core not rotating so that's why moon doesn't rotate .
Some terms might be unfamiliar to you.
But you will learn that in future.
Good luck.