We went through a bit of this when we got Millie. Her formers owners had surrendered her because they bought a new house and Millie was having accidents on their new carpet. (She was 3 years old and these people had had her since she was a pup. )Well, she had several accidents at her foster mother's and several more when she came home to us. It took some time for her to learn what was acceptable and what was not and to remember to go outside to tee tee. Of course we have a pet door, so the learning was much easier on her than on most dogs in the average home.
With regard to the crate, we tried that the first week and she was an absolute basket case. I know most dogs will learn to like, or at least tolerate the crate, but like Emily's Riley, she got too worked up for me to continue it. I left her out one day when I went back to work after lunch and I came home to a totally different dog. From that day on, she had her freedom.