Consider the time when the spring is in max elongation to be t=0.
Assume max elongation as "L"
2 Kg block can never leave contact with ground as maximum force acting on it just tends to lift it.
Therefore equation of shm for 3 Kg block: Lsin(wt+

/2)
Spring force = K* Lsin(wt+

/2)
On the 2 Kg block the following forces act:
1. Spring Force T in upward direction
2. Normal reaction N in upward direction
3. mg in downward direction
The 2 Kg block is in equilibrium hence:
T + N = mg
K* Lsin(wt+

/2) + N = 2g -1
Now K=mw2=3w2
K*L = 2g because at L elongation, 2 kg block tends to leave ground
3w2 * L = 2g
L = 2g/3w2
Put value of L and K in 1
2gsin(wt+

/2) + N = 2g
N = 2g(1 - sin(wt+

/2))