It may be possible that she is seeking your attention. She gets out of bed, you try to get her back in bed, etc. This could be a continuous cycle that she has come to expect and even want.
Anyway, all three of my kids would get out of bed when I first moved them from crib to bed. At first, with my oldest, I did this battle with her, just like you are. Like you, I was at my wits end with her. So, one day I finally decided that if she wants to get out of bed, fine. But, she will stay in her room. When she was tired enough, she would fall asleep where ever she was in the room, for her it was usually in the closet. After I was sure that she was asleep, I went back in, picked her up and put her back in her bed. She would then stay there the rest of the night. After awhile, probably several months, she started to stay in bed on her own. Luckily for me, when my kids went through this stage, they weren't old enough to be able to open the door on their own so I didn't need to put up a gate. However, since your son is older then my kids were, you may need a gate to keep him in his room if he knows how to open his door.
For my oldest, it was this way for naps too. However, all three of my kids were done with afternoon naps by the time they reached 2 years old. When they got to the point that they didn't want to sleep, the nap time turned into quiet time. They were still put in their rooms just like nap time, but they didn't have to sleep if they didn't want to. The could play with their toys, look at books, etc. Just as long as they stayed in their rooms for the quiet time, which for my kids was one hour. It was usually enough down time to re-energize them for the rest of the day.
I hope this helps. Good Luck!