You don't "turn" code into an IFRAME.
You put your form on a Marketo LP. Then you add an IFRAME whose src attribute is the Marketo LP URL.
(Obviously this is a suboptimal way to use Marketo forms. It also will not work if your external domain is running over https but your Marketo LP domain is not.)
Perfect! Thank you.