Hi!!!
My cockatiel Popcorn looks like yours, but mine is a cinnamon pied. I got him 15 years ago with his "brother cage buddy", a white-face grey Peanuts. Then they wouldn't leave their girlfriend Rocket behind, so I had to buy all 3 of them at once. You see... Popcorn was in love with Peanuts, but Peanuts and Rocket became a pair and Popcorn becoming the 3rd wheel (unrequited love😉). So, I have had soap opera pleasure viewing this trio from babyhood to adulthood and all their mating/nesting behaviors. Since they were cage babies together at the breeders, they were attached to each other and got along famously until breeding season.
As to your question, both males and females tails will be "barred" until they go through their first molts. With their first molt, male tiels will lose the yellow or white bars on their tail feathers and the spots on the underside of their wing feathers. Females retain the bars and spots their entire lives. If your bird's tail is too light to distinguish whether the bars remain or not, your vet can tell for sure.
When Popcorn became the same age as your little man and had no female, he would attempt to mount Peanuts until Peanuts ran him off. Peanuts had Rocket, so Popcorn found other ways. He sought out any surface available to squat on and rub his tail like the pendulum of a grandfather clock he accomplied satisfying his "task". Then, he'd go about his regular business.
When cockatiels want to poop, they squat down and wiggle their butts a little bit and are up and running around a second later. Initially, it looks the same as preparation to mate.. However... you can definitely tell the difference between a mating movement and a pooping wiggle. Birds do poop in their food and water. They especially like to poop when they are perched. That's just Mother Nature. A mating movement is definitely the pendulum movement and it lasts strongly until completion.
Popcorn stopped after awhile... a few years. He didn't want Rocket. He was totally in love with Peanuts, but Peanuts was a married man... so that was futile. As long as Peanuts was alive, they stayed very close. Sadly, Peanuts died 2 years ago of a brain disease. Popcorn and Rocket still get along fine, but they're just buddies. Popcorn has untreatable cancer, diagnosed a year ago. He gets pain meds daily. I don't know how long he'll be with me. Rocket is going strong.
Have fun with your buddy. He's very smart and has the understanding of a 3 year old. Needs lots of handling and love.
Good luck.