The equation for motion for the upper block will be given as,
$m_1 a_1=F-F_f$
And that for the lower block will be given as,
$m_2 a_2 =F_f$.
$a_2=\frac{\mu_{k}m_1g}{m_2}$
However this is the case when there is slipping between the two blocks and $F_f$ is at its maxima.
But, when the block move together i.e, $a_1 = a_2 =a$, you will have totally different equations of motion.
$m_1 a=F-F_f$
$m_2 a =F_f$
$a=\frac{F}{m_1+m_2}$ $\tag 1$
Lets take a look at the extreme case when there is no sliding between the two blocks.
Before I start forming the equations, it should be understood that the maximum value of frictional force, in the given condition, is $\mu m_1g$.
Depending on the value of $F$ : the boxes could either stick together and hence, move with same acceleration or slip over each other and have different values of acceleration.
In the extreme case, when the blocks just have the tendency to slip, the frictional force will be at its maxima. Friction force is self adjusting and it tries to be as higher (in magnitude) as it can be, depending on the values of F.
In the extreme case, acceleration of the blocks is the same and frictional force is at its maxima, and $F_{max}$ is that maximum value of $F$ for which no sliding occurs.
$m_1 a = F_{max}-F_f$ $\tag2$
$m_2 a=F_f$ $\tag 3$
$a=\frac{F_{max}}{m_1 + m_2}$ $\tag4$
From the equations $(3)$ and $(4)$ ,
$F_f=\frac{m_2.F_{max}}{m_1 + m_2}$,
$F_{max}=\mu \frac{m_1}{m_2} (m_1+m_2)g $ $\tag 5$
If the value of $ F > F_{max}$, the blocks will slip and have different values of acceleration. For any value of $ F (> F_{max})$ frictional force will be maximum i.e, $\mu m_1g$.
However if $ F < F_{max}$ the blocks will always move together no matter the value of $F$. The value of $F_f$ will shift accordingly in such a way that both blocks move with same acceleration. That's the beauty of frictional force !
Conclusion -
The term for acceleration depends on the value of $F$, the mass of the upper block and the value of $\mu$.
Since you have used $\mu_{k}$ in your equation, the blocks should be sliding over each other. Therefore, they cannot have same acceleration. That's also the reason why you won't get the value of acceleration given by equation $(1)$.
Please note -
For making the equations of motion I have considered constant value of $\mu$. To be specific when there is no tendency between the block to slip the nature of frictional force will be static, otherwise kinetic.