I have faced this problem in my iPhone - "The maximum number of free accounts have been activated on this iPhone".
For solving this problem I erase all content and settings of my iPhone and set it as a fresh new iPhone.
Still facing the same problem.
Can any one help me to achieve this as I have to logged in with multiple apple ids for testing in app purchase in my application to that device.
I just now found a way how to avoid this issue.
You don't need to log in sandbox user account into Your actual iPhone sign in. Dont sign in here
Instead of this, You need to find in settings "iTunes and App Store" find iTunes and App Store
After that scroll down to the bottom until You see sign in for sandbox accounts Sign in here all Your sandbox test accounts
It should not complain about the maximum number of accounts.