How does PvE co-op work?

Hello, Im thinking about buying this game with a friend. But I was wondering, a sides from PvP, PvPvE, Is it possible for 2 players to be allies (as in play in the same faction) while fighting an AI controlled faction?

I think this game will be a perfect fit for my buddy, as he loves playing Age of Empires and Helldivers 2 (or any other FPS/Shooter game).