But he hasn't been confined to the Ecuadorian Embassy. He has been there voluntarily. You can take in to account time served in pre-trial custody but you can't (and wouldn't want to) take in to account time on the run (which is what he currently is). If you did that, it would encourage people to jump bail which is precisely the opposite of the point of the laws around bail.
Maintaining respect for the law around bail is far more important than the fate of this one guy.