The context is important in this passage, and John Gill's notes are helpful.

Galatians 2:14-19 ESV But when I saw that their conduct was not in step with the truth of the gospel, I said to Cephas before them all, "If you, though a Jew, live like a Gentile and not like a Jew, how can you force the Gentiles to live like Jews?" (15) We ourselves are Jews by birth and not Gentile sinners; (16) yet we know that a person is not justified by works of the law but through faith in Jesus Christ, so we also have believed in Christ Jesus, in order to be justified by faith in Christ and not by works of the law, because by works of the law no one will be justified. (17) But if, in our endeavor to be justified in Christ, we too were found to be sinners, is Christ then a servant of sin? Certainly not! (18) For if I rebuild what I tore down, I prove myself to be a transgressor. (19) For through the law I died to the law, so that I might live to God.

Quote
John Gill:

2:17 We ourselves also are found sinners;

(1) that is, either we should be so (found as sinners), were we not to rest here (justified in Christ), but seek to join our own works with Christ's righteousness for our justification, and so make Christ the minister of sin, of an imperfect righteousness, which cannot justify, which God forbid should ever be done by us; or

(2) we are reckoned sinners by you, judaizing Christians, for leaving the law, and going to Christ for righteousness; and if so, Christ must be the minister of sin, for he has directed and taught us so to do; but God forbid that any such thing should be said of him: or

(3) if we are still sinners, and unjustified persons, notwithstanding we seek to Christ to be justified by him, but need the law, and the works of it to justify us, then Christ, instead of being a minister of righteousness, is a minister of the law, the strength of sin, which accuses for it, and is the ministration of condemnation and death on account of it, which God forbid should ever be: or

(4) this is an objection of the adversary to the doctrine of free justification by the righteousness of Christ, as if it made void the law, discouraged the performance of good works, opened a door to licentiousness that men might continue sinners, and live as they wish, being under no restraints of the law, or under obligation to obedience it, and by such doctrine make

2:18 For if I build again the things which I destroyed;

Which must be understood not of good things, for formerly he destroyed the faith of the Gospel, at least as much as in him lay, and now he built it up, established, and defended it; in doing which he did no evil, or made himself a transgressor, but the reverse; he showed himself a faithful minister of Christ: but of things not lawful, such as the rites and ceremonies of the law of Moses, which were now abrogated, and he had declared to be so all over the Gentile world; and therefore should he go about to establish these things as necessary to salvation, or teach men to join the observance of them with Christ's righteousness for justification, then, says he,

I make myself a transgressor;

(1) for he could not be otherwise, be the case how it would with respect to the abrogation, or non-abrogation of the law; for if the law was not abolished, then he made himself a transgressor of it; by neglecting it himself, and teaching others to do so; and if it was abolished, then it must be criminal in him to enforce the observance of it as necessary to a sinner's justification before God. Now though the apostle transfers this to himself, and spoke in his own person to decline all invidious reflections and characters; yet he tacitly regards Peter, and his conduct, who had been taught by the vision the abrogation of the ceremonial law, and acted accordingly by conversing and eating with the Gentiles, and had declared that law to be an insupportable yoke of bondage, which the Gentiles were not obliged to come under; and yet now, by his practice and example, built up and established those very things he had before destroyed, and therefore could not exculpate himself, from being a transgressor: or

(2) these things may regard sins and immoralities in life and conversation; and the apostle's sense be, that should he, or any other, take encouragement to sin from the doctrine of free justification by the righteousness of Christ, as if he was the author and minister of sin, and allowed persons in it; this would be to establish sin, which the righteousness of Christ justifies from, and engage in a living in sin, to which, by Christ's righteousness, they are dead unto; than which, nothing can be, a greater contradiction, and which must unavoidably make them not only transgressors of the law, by sinning against it, but apostates, as the word [greek text]; here used signifies, from the Gospel; such must act quite contrary to the nature, use, and design of the Gospel in general, and this doctrine in particular, which teaches men to deny ungodliness and worldly lusts, and that being dead to sin, they should live unto righteousness.

Blessings,

Kevin


“All that may be known of God for our salvation, especially his wisdom, love, goodness, grace and mercy on which the life of a soul depends, are represented to us in all their splendour in and through Christ.” John Owen