I'm by no means an expert, but I've heard it said that the older puppy/young adult phase is the worst time to get a dog. They no longer have the cute puppy looks to flood your brain with lovey-dovey hormones, and they're coming into puberty, etc. That's not so say getting a dog at that age is a bad choice, just that it's generally understood to be more challenging. So, in that spirit, you're not alone.
Also, there's a "3 day, 3 week, 3 month" adjustment period that dogs go through when adapting to a new home. It seems like you've just reached the 3 month period, so even though you said he's good in the house, he might get even better now that he has had time to settle in.
Maybe contact whoever you've fostering him for and see what advice they can offer?
Unfortunately, that's not much solid advice, but I'm sorry it has been so stressful for you!