There are many conditions that can cause incontinence including: hormonal imbalance, urinary tract infection, disc disease, prostate issues, weak bladder sphincter, and kidney disease.
In many cases of urinary incontinence, a dog will leak urine at night while sleeping and any spraying of urine in the house is not deliberate but rather a voiding of the bladder since muscles are not able to hold it in before the dog is taken outside.
This often improves as the dog matures. It can help to ease into greeting when arriving back home and taking your Maltese for bathroom trips more often.
Many owners mistakenly send the wrong message by attaching the leash and letting the dog scoot out of the house first or by letting the dog dash back inside first.
It's better to keep the leash short, pass through the doorway first, and only after the Maltese is alert to the fact that his human left/entered first, then be allowed to follow.