The balanced equation is:
4 (NH4)3PO4 + 3 Pb(NO3)4 → Pb3(PO4)4 + 12 NH4NO3
Let's start with Pb. Since subscript of Pb is 3 on RHS, we add a 3 before Pb on LHS and sine PO4 has a 4 as subscript we add 4 before (NH4)3PO4 on LHS. This makes NH4​ 3*4=12, so we add 12 before NH4NO3 on RHS. That automatically balances the NO3.