Hi, when I do my first track, everything is great. Then my second track, like a piano , I get a delayed audio. latency of a milli second. when I play my keyboard, I can notice the notes are slightly delayed

Hi, when I do my first track, everything is great. Then my second track, like a piano , I get a delayed audio. latency of a milli second. when I play my keyboard, I can notice the notes are slightly delayed. Is there a setting I need to know about?

Multi-track overdubbing with Audacity takes a bit of set-up.
This tutorial in the Audacity Manual explains how to do that.

To help narrow this down: which Audacity version and Windows version are you using, and what audio device/interface do you monitor through? Also, are you hearing the keyboard through your computer (software playthrough) or directly from the keyboard? Latency of a few milliseconds is often caused by software playthrough, and a lower latency setting or Latency compensation under Preferences > Recording may help.

No, it won’t. Latency correction in Audacity 3 is applied after recording stops in order to line up the overdub with the other tracks.
Please read the tutorial.