I have battled with this over the years on and off. A couple of things have worked for me...
I have one daughter who was always a good sleeper, but got into the habit of coming over in the middle of the night (bad dreams); once they get in that habit, it's very hard for them to break it on their own, even if what started it is no longer an issue. With this daughter (she was about 5 at the time)I eventually made a little bed on the floor next to me (a sleeping bag is ideal) and told her she'd have to sleep there if she came over because I just couldn't sleep with her in my bed and I need my sleep too to stay healthy. She was fine with this. Then, after a few nights of that, I rolled up the sleeping bag and put it into the corner of my room and told her that if she wanted to sleep in my room, she'd have to make the little bed when she came over. She was OK with this, but it didn't take more than a few nights and she stayed in her own bed again! The idea was to make it difficult for her; it was too easy for her to just come over and hop in my bed, and I was always way too tired to walk her back over and over again each night.
This strategy did not work for my other daughter, but I found one that did and am currently implementing it. She too was always a good sleeper, but got into the habit of coming over after an illness. This daughter (8 yrs old) is extremely competetive and always responds to a challenge. So, I made a chart for the three daughters and gave them a star sticker for every night they went to bed well and stayed in their own beds for the whole night. I gave half stars if they stayed in bed, but behaved poorly at bedtime or whatever. I said that at the end of a week (7 nights) they would get a reward. I decided that the reward would be $ and they could choose what to do with it. I valued each star at $.50 and each half star at $.25; they earned NO $ unless they had gotten a minimum of 5 stars that week. At the end of the week, they got paid. My plan is to carry out the chart for 3 weeks (then it will just kind of disappear) banking on the theory that it takes that long to establish/break a habit. Let me tell you though, this daughter (who screamed and yelled about the chart initially) earned 5 stars the first week (adding up the half stars); seven stars the second week, and is about to get seven stars for this last week! She always responds to a challenge!!! Initially, she was so against it and said she would not participate. I told her that it was my chart, not hers and that I was going to keep track because I wanted to. I said that at the end of the week, if she had earned any $, she could choose not to accept it, but that being on the chart was not a choice because it was MY chart. This worked. Also, I praised her each day that she had had a good night, telling her how proud I was of her!
Also, I think laying with him until he falls asleep goes against your ultimate goal. He has never learned to fall asleep on his own and he needs to! When he wakes in the middle of the night, he is not able to fall back to sleep unless he is near you, because that's the only way he knows how to fall asleep. This is a habit he needs to learn his way out of. One thing you can try is to lay with him one or two more nights, but leave before he falls asleep. Then, the next couple of nights sit next to the bed, but leave the room before he falls asleep! Then, sit in the room for a couple of nights, but not right next to the bed. Then, put him to bed and tell him that you'll check on him in 10 minutes. After 10 minutes, go in, kiss him and leave saying you'll check in a few more minutes; go back 15 minutes later and so on until he's asleep. Continue this checking on thing for as many nights as necessary. Be sure not to have a clock in his room or he'll stay awake counting the minutes until you come in.