In the reaction H2(g)+Cl2(g)⇌2HCl(g):
Kp=Kc
H2(g)+Cl2(g)⇌2HCl(g)
Kc=[HCl]2[H2][Cl2]
Assuming all the gases behave ideally, we can write PiV=niRT for each gas but now look at the units of concentration, which are mol/L. That is just means that niV=PiRT.
Substitute that into Kc:
Kc=P(HCl)RT2P(H2)RT×P(Cl2)RT
=P2(HCl)P(H2)×P(Cl2)=Kp