Of course, Song Shuhang was only joking when he thought of peeing in the middle of the formation as lions did to leave his smell behind. If he were to do it for real, Scholar Xian Gong might tie him up and throw him within the trap he prepared, using him as a living bait to attract the demodragon.
Anyway, it was pretty simple for cultivators to leave their 'smell' behind. Both 'true qi' and 'spiritual energy' carried what one could consider the characteristic 'smell' of a cultivator.
Song Shuhang only had to follow Scholar Xian Gong's instructions and inject his true qi inside a transparent crystal—which was the core of the formation—if he wanted to leave his 'smell' behind.
This transparent crystal was, in fact, a spirit stone with almost no spiritual energy inside. After passing through a few modifications, it was turned into a special type of crystal that allowed others to inject their true qi or spiritual energy inside.