First of all may I applaud your reaction to to your sons choice, there are not so many parents who would straight away try to accept and understand their older child's desire for diapers, Most become angry/defensive/stressed/fearful etc. and try to outright stop and/or fix the "problem" when there is actually usually no problem to fix. That you are here seeking ways to support your child through this clearly shows how much you love and respect him for who he is or wants to be and for that I thank you.
Now as RainbowConnection said the rules you have laid out for him are entirely reasonable for his safety, and I do notice that you have not asked for how you might punish him for breaking those rules which is again close to a miraculous attitude/behaviour for a parent, and I do hope you can maintain that as I can tell you now that at his age attempting to penalise/punish may lead to worse outcomes.
I'm not going to touch on the TBDL side as it sounds like you are already accepting of that but there is plenty of supportive people here who can help you understand that part of him better should you want to. I do have a few questions though for the rules part:
Is he your only/eldest child? I'm sure you're aware but at 12 he is rapidly approaching that age where boys really begin to discover themselves sexually, prohibiting him from exploring that will only exacerbate his need to explore and possibly lead to him taking greater risks to do so. While I can not condone allowing a minor to peruse erotic content he does need to understand it and given that he has already broken the sexual content rule he may need something more than the usual "when a mummy and daddy love each other..." talk. Which leads on to the next question.
Where are you from? (this is a little rhetorical you don't need to answer) If outside the USA this is probably less of a thing but I ask because, without trying to be stereotypical, I know that in many parts of the USA sex ed. is practically non existent, I've heard so much about 18-20 year old Americans who have no idea about sex (anatomy, risks, protection etc.) because their family avoids talking about it and the schools don't teach them. In the UK I had my first (very basic) sex ed. lesson in primary school (at 10 years old) and more detailed in secondary (at 11 years old) so depending on what you and his school teach him you may need to go a little deeper.
The sexual content/pictures/videos rules he broke, was he uploading pictures/videos of himself online? just taking pics and vids of himself for personal reasons/use (not uploading)? or was he just accessing erotic content online?
If he is uploading things then of course that needs to be stopped, he needs to be aware of how dangerous that is. it may be hard to make him listen and accept as he is at the rebellious age but communicating with him is vital. I say COmmunicating there instead of speaking to/telling because it HAS to be a two way discussion, he needs to be aware of the risks and why you won't allow it but you also need to learn why he feels the need to share personal images and work through it together.
If he is taking pics/vids purely for his own use then maybe find a way that those can be taken and/or kept securely (like an encrypted usb drive, and not on a phone or computer) and limit what he has/does. It is very common these days for children entering their teens to take pictures and videos of their genitalia/self pleasure, it is just another way to explore and understand their bodies that is more accessible in the modern world with smart phones/webcams and removing these devices will only alienate him and lengthen the time it takes him to learn and become used to the new feelings, again increasing the risks he may take to do so.
If all he was doing was looking at porn on the net and not taking his own things that should probably be restricted as it is technically an offense to provide or knowingly allow a minor to view pornographic material. There are many, many pieces of software you can install on pc's/mac's/phone's etc. to prevent access to those kinds of websites.
There is however a caveat that there are 10 times as many websites that can teach him how to work around those blocks and using these may also cause him to find ways to hide what he is viewing, this latter part is a problem because it seems like you currently have quite an open and inviting relationship with your son but if he feels he needs to hide things from you, the amount of things he hides will grow and he may become more distant/less open to you. I don't have kids but if it were me I would rather turn the other cheek to them watching naughty vids (while monitoring the history of where they were/what they did) than have them visiting websites built by pervs that are happy to teach minors how to access that material, doing shady things to get access or simply going out to try it for real.
All of it really comes down the that whole CO-mmunication thing, giving him the opportunity to open up and listen to his views/thoughts while sharing your own and working together. A good therapist will help here but you need to tell your son that you are not trying to "cure" him, that you accept him for who he is and what he wants, that you just want to support him and protect him. you also need to make sure the therapist understands that you are ok with his TBDL, you don't want to change him and that you just need support support him understand his choices and the importance of following boundaries and exploring safely.
I'm going to leave that there for now as it got longer than I intended.