Here in this work, we have used density functional theory to design and investigate 2D covalent organic frameworks (COF) comprise -conjugated B- and N-doped phenalenyls (TB and TN) as core molecules and BNH2, C2H2, C2H4, C6H6, and N2H2 as linkers. The designed COFs are topologically planar and possess the famous kagome lattice. The materials are found to be intrinsic semiconductors with HSE06 band gaps in range of 0.045-0.853 eV. Our exhaustive electronic structure analyses have led to identifying design principle of control over the dominant type of carriers in each sheet. It is found that the dopant (B, N) actually determines the types of charge carriers. From the band structures, in TB-based COFs, valence bands are highly dispersed, while conduction bands are almost flat. The flat conduction bands do not contribute to the electron transport in TB-based COFs, indicating these polymers are p-type semiconductors. An apposite dispersion pattern is observed in TN-based OFs’ band strcutures, indicating that they are n-type semiconductors.