In books? In series? I thought in either, it was because of Stannis' letters that he first came to know it (or if he didn't believe it: he was first came to be informed about about such possibility), but that doesn't seem to add up with Renly convincing Ned to kidnap Joffrey.
Related questions:
What is Renly's basis for removing Joffrey?, What was the basis for Lord Renly's claim to the throne?, Since Joffrey was a minor, why the urgency?