Two sine wave of 0 to 5V,with a frequency of 500Khz. How do I find the phase difference between the two sine wave
You need a phase error detector.
A classical, because cheap, easy, relatively noise-tolerant and clever way to do that is

&quot;slice&quot; these sine waves so that they become bipolar square waves (e.g. by amplifying them very much and clamping them, or comparing them to 0V, or...)
XOR the two (e.g. with 74xx logic gate)
average the result over time (e.g. with a simple low-pass filter).

Since the time that these two square waves don't have the same sign is proportional to the phase between them, and XOR is only high when its two inputs are different, the average of the output is proportional to phase.
That's how a lot of PLLs implement their phase error detector.