Rats will generally mark their territory the same way most other animals will, by urine scent marking.
They do have pheromones and they do have a specific scent in their urine, and they will use it to scent mark.
Generally, this behavior is exhibited by male rats. Generally, male rats that have not been neutered that may feel the need to leave their urine scent all over their cage. Sometime they'll leave that scent on bedding or hammocks or any type of cloth material in their enclosure.
There are even some that feel like they need to mark with their urine anything. When you first pick them up. When you handle them. When they're out in a new environment.
It's also thought that sometimes they will use feces as a marker. Although, in general, urine scent marking tends to be more commonly associated with the rodent species.
The female rats, as well, do often use urine scent marking as a means of denoting territory, of noting their presence.
And, in the wild, scent marking and the pheromones that exist in the urine are part of the attraction. They're part of seeking out and finding mates. And they're also important aspects of declaring areas that may be territory for a particular rat.
In most cases, rats that may be doing an excessive amount of scent marking are using their urine, or where the urine odor is a bit strong, it's recommended that those male rats be neutered.
That way it will curb the behavior to some degree. It will take away the hormonal urge to scent mark. And, it will also help with the odor from the urine.