>okay so how is countries defined for that definition, because countries aren't people
Well, if one country invades or controls another sovereign country through force, that is clear imperialism. A country can also inherit subject areas that were conquered long ago in past acts of imperialism, and that gets a little more complicated, but the first definition is unambiguous.
>Either way because that is starting to sidetanget, yeah even democratic states can exploit other peoples not included into that democracy's ingroup (a dictorship of a class, that class as a whole is empowered, and the state exists for that classes interests)
For sure.
>But how to ensure that said means of production will be used in the interests of the people of that country, through collective ownership, democratic empowernment. The Capitalists do not share the interests of the vast majority, in basically every example of colonialism or imperialism you will find local collaborators that benefits from the subjegation and are a separate class from the vast majority.
Still, none of this necessarily protects against imperialism, just look at the USSR. Anti-imperialism relies on respecting the sovereignty and rights of other nations, even if they are vastly different than your own and have a vastly different form of government.