If you've just brought home a newly adopted shelter or rescue dog, your first task will be to be sure he's housetrained. If not, then you'll want to have him become housetrained ASAP. One big advantage of housetraining an older dog is that he has more bladder and bowel control than a puppy - is able to "hold it" for longer periods of time. However, in the beginning your new dog won't know where to go, and his system may be upset from a change in location and/or food, which can cause diarrhea. So at first, introduce him to his bathroom area and let him eliminate before bringing him in the house for the first time. Be patient and wait if necessary, praising him when he does.
After you bring him inside, don't expect him to know right away to tell you if he has to go out. Just expect it, and take him out, very frequently at first, praising him each time he goes. Once you are sure he is eliminating normally with no diarrhea or other upsets, then put him on a regular elimination schedule as you would a puppy: in the morning, after meals, after play, and at night before bed. Accompany him, and praise him each time he goes. Make it a point to prevent accidents before they happen, rather than deal with or discipline him if they happen. Never punish him for an accident. Rather, just quietly clean up any mess, and continue with your schedule.