40k armies work based on Detachments. Detachments are made up of units.
To start, every Detachment has minimum requirements, and maximum allowances. The basic Battalion for example needs two HQ units and three Troops, but it can have a few more. A Patrol however only needs one HQ and one Troops as minimum.
Different sized or types of Detachment give you Command Points, which are used to activate Stratagems. Battalions give 5, Patrols give 1, for example.
Importantly, every unit in a single Detachment must share a Faction in common, however for Detachment, this Faction can not be Chaos (or Imperium, Aeldari, or Tyranids).
And army can be made of multiple Detachments, each of which has its own Faction, so long as every Detachment in an army has another Faction in common. At this level, it CAN include Chaos (et al).
So one army can have a Detachment of Thousands Sons, a Detachment of Black legion AND a Detachment of, for example, Nurgle Daemons. Because they are all also Chaos.
Here's the important part.
There are some special rules that you only get if a Detachment uses a certain Faction. For example, if EVERY unit in a Detachment is Thousand Sons, you are able to use the Thousand Sons special rules for the Detachment, including their abilities, psychic powers, stratagems, warlord traits and relics.
If however there is one unit in the detachment which is NOT Thousands Sons, you don't get any of these bonus rules.
You CAN have a single Detachment in your army which includes Ahriman and Abaddon, because they both have the Faction "Heretic Astartes". This is a game legal ("battle-forged") Detachment for an army.
However the detachment would not gain any bonus special rules like it would if it were a specific Legion (such as Thousand Sons).
The best thing to do is have Abaddon somewhere else. Look at the available Detachment types, and assemble your Thousand Sons into one detachment, and have Abaddon seperate in another detachment, ideally along with some other Black Legion units to back him up. That would then give you two Detachments in your army, both Chaos, but also getting special rules for being united as other Factions.