This is copy and pasted from the link listed by bleakwise.
Et tu, Brute?
So you’re right that sale of a product incorporating UE4 (in whole or in part, even small part) would be royalty bearing.
So if you’re talking about distributing source code from UE4, even in small amounts, that can only be to engine licensees and not to the general public. The easiest way to do that is through the UnrealEngine GitHub network (although I don’t know that there’s a way to charge via that mechanism) or through the Marketplace (where of course there is a way to charge).
If the code doesn’t come from the Developer or Editor folders, you’re not necessarily restricted to distributing through those two channels, but we also don’t currently provide an easy way for you to know for sure who is an engine licensee.