how can i change the apple id on App Store? On my 2009 MacBook, my friend signed into his Apple ID to check it. Now, I can't sign back into mine to download things.

Does anyone know how to get my Apple ID to sign me back in?
In the Mac App Store, go to the Store menu -> Sign Out. This will allow you to sign out of the store. 

Note, if he made any purchases during that time, downloaded any apps and/or accepted the updates for the iWork/iLife applications, they may b tied to their AppleID and won't process under yours.