Chihuahuas are often very fearful dogs. It can take a lot to get them to trust you. Add to that the trauma your new pup has already been through and the strangeness of a new home and new people and you have the recipe for a lot of work and time ahead of you.
When dealing with this sort of fear, I highly recommend consulting a professional dog trainer who works with anxieties. They will be prepared to make a plan and coach you and your dog through it to help him overcome these challenges.
If that is not an option, you will need to do a lot of research and have more patience than you might have thought possible. You should look for books about overcoming dog anxieties and working with fearful rescue dogs. There are whole websites about it as well. Here are some guidelines to get you started:
-Don't force your dog to be too close to you, and do your absolute best to avoid scaring him- it will only make his fear (and behavior) worse.
-Keep him in a place that is easy to clean up, like a pen in a tiled kitchen, since you likely won't be able to take him outside anytime soon.
-Make sure he has a snug, dark crate that has blankets and padding inside so that he can go hide if he needs to. Take the door off of it so that he can't accidentally lock himself in or hurt himself. Never force him into or out of the crate- it's his safe place.
-He's still a puppy. Make sure he has things to chew on and play with.
-Talk or sing to him when you are around so he can get used to the sound of your voice. Don't make any sudden movements toward him, but be around as much as possible.
-See if he will eat while you are present. Put his food near his crate and sit still at the other end of the room (I recommend bringing a book or your phone) and be patient. If he doesn't eat, just try again at the next meal. Once he is eating without hesitation, move a little closer at the next meal. If he gets scared again, back up. Your eventual goal is for him to eat from your hand.
-Then, start feeding him meals while you lightly pet him. Hand feed him bits at a time, as you slowly pet his chin, head, and back. If he whimpers, backs away, or growls, stop touching him and try again later. Repeat this at every meal until he no longer shakes as you do it.
-Once you can pet him, start getting him used to a harness and collar. He may have had bad experiences with collars before, if children grabbed them and hurt him, so take it slowly. Start by setting the collar/harness on the ground and letting him approach and sniff it. Give him treats each time he approaches it for a few days. Then hold it and give him treats when he approaches it in your hands. Slowly take the unbuckled collar and hold it against his neck (don't close or buckle it). Wait a second, and then reward him. Do that for a day. Drape the collar over his neck without buckling it. Reward him. Eventually, clasp the collar, wait just a moment, and take it off again. Repeat several times. Start leaving it on during meals, then during play or pet time, then all the time. You should always walk him with a harness, since chihuahuas are so small and easily prone to neck injury from leashes attached to collars, so you will want to repeat this whole process with a harness and then with a leash attached to it. Make sure he is very comfortable walking around your house with a harness and leash before you try to take him outside.
-Once you can pet him and leash him, you can finally start doing normal training with him like potty training, socialization, and basic obedience.
If you feel like you can't handle this for the next several months, that's okay. Call around to various shelters and find one that is a "no kill" shelter. You might also look and see if there is a chihuahua rescue group in your area/region, since rescue groups often have a more dedicated network of volunteers to foster and give this pup the attention he needs.
Good luck with whatever you decide!