There can be two cases :-
If any external force is applied but still the box in at rest.
If no external force is applied on the box then also it would be at rest.
It depends on if any external force is applied on the box but still it is not moving then you need to include the static friction but if no external force is applied on the box then you dont need to include the static friction.
Just keep in mind that you will need to include the friction if any external force(except gravity and normal reaction) are applied on the object because friction always opposes the motion of any object.
It can not act on a body until an external force is applied on that body which tries to move it.
Hope it helps!