When does a follower's position inside the Ka'bah invalidate the following?

Prayer inside, on, and around the Ka'bah