Line Render to target

How do I draw a line render from my origin to my target?

lineRenderer.SetPosition(0, transform.position)
lineRenderer.SetPosition(1, target.position)

this renders line from index 0 (origin) to index 1 (target position).