Everything about that sounds like a urinary tract infection, so I think he needs a vet visit ASAP! But, when you say he was outside (for like the last five years before your got him?) and is now inside, he may also not be housetrained. Repost if you need some help with that, it takes some concentrated time and effort, but GSD's are SUPER easy to housetrain, so that is fixable. But vet check first, since it's impossible to housetrain a dog with a UTI. Good luck!