First, talk to your doctor about your knees. It may be something as simple as a shoe insert. Or it may be something that walking will help.
If your doctor gives you the OK for walking, take him to an obedience class. It's once a week normally and will help him socialize with other dogs and people - invaluable. Then, each night you are not at obedience class, spend 1/2-1 hour walking him and practicing what you've learned. It is not running, etc., and will likely help your knees.
You say "we". If you can't take him out for obedience and socialization, then make it the responsibility of one of the other family members. That's the great thing about obedience training - it doesn't require an adult. A child 10 or older can easily learn obedience and master walking the dog. That would allow you to sit and watch while they do the work.
Terriers are thinkers. While physical exercise is great, they do best with mental exercise. Do a search on "mental stimulation toys" for dogs. There are lots of different options. Those toys while you are at work can help a lot.