Random numbers use what's known as a "seed" as the starting value to a mathematical equation that simulates randomness. If you give the random number generator the same seed you'll always get the same sequence of values, so the first number will always be the same. You can specify the seed in the constructor
Random(yourSeedHere)
In order to be truly random the seed also needs to be random...so you need a random number to get random numbers, how does that work?
When you leave off the seed as you have in your code (you use the parameterless constructor for Random)
Random r = new Random();
then it uses the current time as the seed, or more accurately the current number of "ticks". So when you create two instances of Random, they are created at different times so use different seeds. However, if you run your code in a loop that fires multiple times per tick, all instances uses the same seed so generate the same number.
The solution to all of this is simple...create the Random class once and re-use it rather than creating a new one every time.
Random r = new Random();
int newRandom = 0;
int lastRandom = 1;
private int GetRandom()
{
newRandom = r.Next(0, 7);
while (newRandom == lastRandom)
{
newRandom = r.Next(0, 7);
if(newRandom != lastRandom) break;
}
lastRandom = newRandom;
return newRandom;
}