Which law of newton is an object in motion stays in motion or an object at rest stays at test unless acted on by an outside force

Newton's first law of motion, also known as the law of inertia, states that an object at rest tends to stay at rest, and an object in motion tends to stay in motion with the same speed and in the same direction unless acted upon by an external force. So, the law you mentioned is related to Newton's first law of motion.