I think my dog is sick

Sa
We have a dog, his name is Crosby. He's a German shepherd mixed with a beagle (we think?). We adopted him about 2 years ago, and the people from whom we adopted him said he was about a year and a half old at the time, but we think he's much older. The vet estimates that he might be about 6 or 7 years old now.
Anyway, something's up with him. He used to be pretty overweight but he's suddenly stopped eating most of his food and now he's down several pounds. On top of that he refuses to poop or pee outside anymore. We'll let him out and he just stands around. Then he'll come inside and finally poop and pee somewhere in the dining room. But we think he sometimes goes days before he passes any kind of waste. He gets regular exercise, we feed him a normal dog food once a day along with a homemade dog food once a day. He's seriously the sweetest dog ever, so I don't think this him having a bad attitude or anything.
We need to make an appointment with our vet soon, but do any of you have any ideas as to what could be going on with my dog??