The Form 5472 filing requirement comes down to two questions: is the entity at least 25% foreign-owned, and did a reportable transaction happen during the year? If the answer to both is yes, a filing is generally required.
Entity types this applies to
Most commonly, a US single-member LLC that has elected (or defaulted) to be treated as a disregarded entity, with a non-US person as its sole owner. It also applies to certain foreign-owned US corporations and to foreign corporations doing business in the US.
What counts as a reportable transaction
Capital contributed to the LLC, money the owner withdrew or was distributed, expenses the owner paid personally on the LLC's behalf, and any loans between the owner and the entity all count — even informal ones with no paperwork.