We know that there are 613 mitzvos. However, they cannot all be observed by one person. Some mitzvos only apply to a kohen, while others only to a levi. Some mitzvos apply only to a kohen gadol while some only to a king or to the Sanhedrin. Some mitzvos are only applicable to women while some only apply to those who own property. This leads us to the question of how Yaakov can say, “Although I lived with Lavan, ותרי"ג מצות שמרתי, I still observed the 613 mitzvos.”
How is it possible for Yaakov to observe the 613 mitzvos if they cannot all be observed by one person?
There are different answers given to this question but we will focus on one. The Ben Ish Chai writes that one can fulfill the mitzvos simply through anticipating deeply or truly wishing he can do them. Just wanting deeply to fulfill the mitzvos which are inapplicable to you already makes it is as if you fulfilled it! This is in line with what Chazal say that a good thought (i.e., entertaining the thought of fulfilling a mitzva) is regarded as a good deed.
In this way we can explain what Yaakov meant when he said that he observed all 613 mitzvos. That is to say, he truly deeply desired to fulfill the ones he was unable to do. Consequently, it is considered as if he fulfilled all 613. This is what ותרי"ג מצות שמרתי means as שמרתי can also mean to anticipate as in ואביו שמר את הדבר, where the word שמר means to anticipate.
Let us all take a lesson from this and deeply desire to fulfill mitzvos that we are unable to perform. Then it will be as if we fulfilled them.