I've had the same thing happen - the owner swore her golden doodle went to bed at 8 pm every day, like clockwork. He did not. 2:30 am, he was still pacing around and barking at every tiny noise outside. As everyone else has said, lots of exercise will help diffuse some of that nervous energy, but especially if it's a dog you don't know well in a brand new environment, there's not always a good fix besides time. Physical exhaustion only goes so far.. imagine you've had a few too many cups of coffee. You can be physically exhausted but you still can't get your mind to just turn off so you can sleep.
If you can get the dog to engage in mental activities, like a stuffed toy or working on obedience or learning a new skill, that will likely have a better effect, but a dog that is really anxious may have next to no attention span for that sort of thing. Every new sound or smell may trigger more anxiety, and if you compound that with frustration over not being able to figure out what you've asked of them, it may not help. Start small.. remember you don't have a really strong bond with this dog yet, and work with them as though they've never had any training at all. Reward generously, and advance slowly.
For times when you can't be interacting with the dog (you have to sleep, even if the dog won't!), you can try putting the dog in a more confined, safe space with some white noise, music, or TV on. The noise can help with calming, especially if the pup is triggered by the sounds around your house. If all else fails, the majority of the anxious behavior usually stops after the first night or two.