While I'm not an expert that looks probably more like a prolapsed penis than intestines. You may want to search this site or google for what other people did for that situation, it's not too uncommon. Googling it will likely bring you to the best threads on this site for information. Since he's not obviously bleeding or dried out, it's not serious --- yet. It may go back in of its own accord or he may have torn something and require some help. Sometimes people treat it akin to a prolapsed hen who won't stay put.
Best wishes.