Hello,
I have an 8 year old female Jack Russell and I have the same problem. Although she knows to go outside (we have a dog door), she continually pees on throw rugs or any other carpet in the house. She sneaks to do it as well. No one ever witnesses her doing it!
We have been through so much carpet over the past 8 years that we decided to change to ceramic tile. She rarely pees on the tile - but any throw rugs are prime targets.
I always believed that she was just being spiteful. She's the most obnoxious dog we have (we have four dogs - Yellow Lap, Japanese Chin, Jack Russell and Yorkie mix). Even our neighbors hate her! LOL