What is correct or not in case such as this is largely a convention. In British English, If I would have known you were coming, I would have baked a cake is considered incorrect both because prescriptive writers tell we have to say If I had known and because descriptive writers confirm that that is what we do say in standard BrE (but see the note at the end of this answer).
I don't know what the 'rule' is in American English, but I know from contact with Americans over the last fifteen years that many of them say If I would have known .... Discussion with trainee teachers suggests that many of them believe it is correct.
Note. In British English,
Instead of an ordinary preterite perfect, a non-standard 'double
perfect' is often found:
If it had've come yesterday he would surely have told her.
I wish he hadn't've left.
This is largely restricted to speech (or the written representation of
speech) It appears to be increasing in frequency and though it is not
yet established as a standard form, it is used by many who in general
speak standard English
Huddleston & Pullum, 2002.151, The Cambridge Grammar of the English
In contracted forms such as If I'd've known ..., one cannot say for certain whether the 'd is a contraction of had or would. However, most British speakers who use this form expand the 'd to had in emphatic and negative utterance.